home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
bbs
/
cddk9606.zip
/
DOCS.ARJ
/
CONCERTO.DOC
next >
Wrap
Text File
|
1996-06-14
|
123KB
|
4,320 lines
┌──────┐ ┌──────┐ ┌─────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌───────┐ ┌──────┐
└──────┘ └──────┘ └─────┘ └──────┘ └──────┘ └──────┘ └───────┘ └──────┘
┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌────┐ ┌──────┐ ┌─┐ ┌─┐ ┌─┐
│ │ │ │ │ │ │ │ │ │ │ │ │ ┌──┘ │ ┌─┐ ┌┘ │ │ │ │ │ │
│ └────┐ │ └──┘ │ │ │ │ │ │ └────┐ │ └────┐ │ │ │ │ │ │ │ └──┘ │
└──────┘ └──────┘ └─┘ └─┘ └──────┘ └──────┘ └─┘ └─┘ └─┘ └──────┘
The Concerto Door Development Kit
Version 960616 (Wide Beta #2)
(c) 1996 David J. Pinch ∙ All Rights Reserved
Dedicated to Kelly Wells
"It is not the stars to hold our destiny but in ourselves."
- Shakespeare
1 Title
2 Introduction [search keyword]
Welcome ..................................................... /WELCOME
Features .................................................... /FEATURES
Requirements ................................................ /REQUIRE
Installation ................................................ /INSTALL
Release Schedule ............................................ /RELEASE
3 Aspects of Concerto Doors
Scripts ..................................................... /SCRIPTS
Macros ...................................................... /MACROS
Command-Line Parameters ..................................... /PARAMS
Color Protocols ............................................. /COLORS
4 Programmer's Reference Manual
Units ....................................................... /UNITS
Global Variables & Constants ................................ /GLOBAL
Format ...................................................... /FORMAT
Library ..................................................... /LIBRARY
▀▀▀▀▀▀\
▀▀\ Introduction to Concerto
▀▀▀▀▀▀\
▀▀\
▀▀▀▀▀▀\
w e l c o m e /WELCOME
──────────────────────────────────────────────────────────────────────────
Concerto is a world-class door development kit for Turbo Pascal 7.0.
Concerto allows you to produce spectacular online games and utilities
with little effort. You can spend your time designing an intricate
plot or drawing a set of ANSI screens -- instead of dealing with
the low-level mechanics of communications programming.
f e a t u r e s /FEATURES
──────────────────────────────────────────────────────────────────────────
State-Driven Color System
Concerto supports all mainstream color-code systems, including ANSI,
AVATAR, HexPipe, LORD (Legend of the Red Dragon), PCBoard at-codes,
RemoteAccess ^k codes, and WildCat! BBS codes. Color codes are
converted and optimized at run-time.
Multi-Tasker Support
Concerto releases time-slices to DesqView, DoubleDOS, TopView, Windows
and OS/2. Concerto auto-senses SHARE, the DOS 5+ task switcher, and
many other enviromental factors that can affect operation of the door.
Extended support has been provided for Windows and Windows 95. You may
access the clipboard, maximize the DOS box, or change the title of the
application's window.
Script Interpreter
Concerto has a built-in script interpreter with a rich library of
commands and variables. You may use this library as-is, or make
your own. You have the ability to make any variable in any unit
accessible to the sysop.
Sysop Power
The sysop can create his own function keys, status lines, and command-
line parameters. Every aspect of the initialization sequence is defined
in an external script -- right up to activating the FOSSIL driver and
setting up the chat-mode.
Extended Libraries
Concerto is more than a simple door driver. We've included hundreds
of support routines in a plethora of areas -- including DOS, rebooting,
lightbar'd menus, pChar support, VGA graphics and much more. Our
top-down, organized approach to programming means that you'll be able
to use 90% of these routines in non-door enviroments.
r e q u i r e m e n t s /REQUIRE
──────────────────────────────────────────────────────────────────────────
Turbo Pascal 7.0
Concerto uses many of the extensions provided in Turbo Pascal 7.0.
These include pChars (null-terminated strings), CONST parameters,
and OpenArrays. We have no plans to support version 6.0 or earlier.
FOSSIL [Fido/Opus/SeaDOG Standard Interface Layer] Driver
A FOSSIL driver allows a BBS or door to access your communications
hardware in a device-independent manner. You must install a FOSSIL
driver specific to your hardware or operating system. Drivers are
available for DOS, Windows 95 and OS/2. (NOTE: doors running in local-
mode do not need a FOSSIL driver).
SHARE.EXE
A file-sharing driver is required for multi-node operation. SHARE
manages conflicts when two or more instances of the program try to
access the same file simultaneously.
EGA/VGA Video Card
Some procedures and functions are disabled if an EGA or VGA graphics
card is not detected at startup. Most of these effects are purely
for the enjoyment of the sysop and do not affect the functionality
of the software.
i n s t a l l a t i o n /INSTALL
──────────────────────────────────────────────────────────────────────────
1. Change to the Turbo Pascal directory (i.e. C:\TP).
2. Make a directory for the Concerto units (i.e. C:\TP\CONCERTO).
3. Copy the contents of the UNITS archive to this directory.
4. You may wish to repeat steps 1-3 for the other archives.
BBS_INFO . . . . . . . . Concerto GIF; ads for support BBSs
DOCS . . . . . . . . . . Documentation
FREE . . . . . . . . . . Royalty-free ANSI screens and sysop docs
HEADERS . . . . . . . . Unit headers and additional documentation
TUTOR . . . . . . . . . Tutorial series
UTIL . . . . . . . . . . Optional support utilities
5. Run TURBO.EXE or TPX.EXE.
6. Go to the Compiler Options menu (press ALT-O, then press C).
7. Select the following options:
[X] Force far calls . . . . . . . . . . . . . . ON
[X] Extended syntax . . . . . . . . . . . . . . ON
Alternately, you may use these switches in your main program:
{$F+} { Force far calls }
{$X+} { Extended syntax }
8. Go to the Directories menu (from the IDE, press ALT-O, then D).
9. Add the CONCERTO directory (step #1) to the INCLUDE DIRECTORIES list
and the UNIT DIRECTORIES list.
10. Save your settings. From the IDE press ALT-O, then press S.
r e l e a s e s c h e d u l e /RELEASE
──────────────────────────────────────────────────────────────────────────
Updates to Concerto are released on the New Moon of each month. We
are constantly optimizing code, fixing bugs, and adding new features.
Release Date Version Archive Name
--------------------------------------------------------
Wide Beta #3 15th Jul 1996 960715 CDDK9607
Wide Beta #4 14th Aug 1996 960814 CDDK9608
Wide Beta #5 12th Sep 1996 960912 CDDK9609
Wide Beta #6 12th Oct 1996 961012 CDDK9610
Wide Beta #7 11th Nov 1996 961111 CDDK9611
Wide Beta #8 10th Dec 1996 961210 CDDK9612
You are currently using Wide Beta #2 (version 960616). This version
was released on Sunday, June 16th, 1996. Refer to SUPPORT.DOC if a
newer version is available.
▀▀▀▀▀▀\
▀▀\ Aspects of Concerto Doors
▀▀▀▀▀▀\
▀▀\ Please run the tutorial series before reading this section.
▀▀▀▀▀▀\
s c r i p t s /SCRIPTS
──────────────────────────────────────────────────────────────────────────
1. Overview
The built-in script interpreter manages the set of functions and
variables accessible to the sysop. Its tasks include token parsing,
variable assignments and conversion of data types.
Scripts are totally free-form: More than one command may exist on a
single line, and parameters can extend across multiple lines. Line
feeds, tabs, and other whitespace characters are all handled gracefully.
2. Comments
A semicolon forces the interpreter to ignore the rest of the text on
the current line. This is an excellent way of placing comments in a
script.
3. Identifiers
An IDENTIFIER is a word or string that refers to a variable or function.
■ Identifiers are not case-sensitive.
■ There is no limit to the length of an identifier.
■ Spaces are allowed if double-quotes are used.
■ Numbers, underscores and other special characters are legal.
Example: ClrScr
Example: ComPort
Example: "My Var"
Example: _Cheese!
4. Functions
A function performs a task, such as clearing the screen or creating
a subdirectory. Functions can accept any number of parameters.
Example: Write "Hello World!"
Example: Color 7
Example: ClrScr
5. Variables
A variable contains a piece of information, such as the communications
port or the name of the BBS. Modifying a variable is much like QBASIC:
LET Variable = Value
│ │ │ └──── A value to copy into the variable.
│ │ └─────── Assignment operator (optional)
│ └─────────────── Variable name
└─────────────────── LET Keyword (optional)
6. Registration
The question arises: Where do all of these functions and variables
come from? How does Concerto know that "ComPort" refers to
the communications port used by the FOSSIL driver?
Answer: Registration
A registration procedure associates an identifier with a particular
variable in your program. Once registered, the sysop can modify
the variable in a script or display its contents in a string or
text file (refer to the MACROS section for details).
RegisterByte('TextAttr', @TextAttr);
RegisterWord('ComPort', @ComPort);
│ │ │
│ │ └─ The address of the variable in your
│ │ program.
│ │
│ └─────────── An identifier (see part 3 above).
│
└──────────────────────── The registration procedure. ALWAYS USE
THE CORRECT REGISTRATION PROCEDURE.
Otherwise, you will experience memory
corruption! The TYPES.PAS unit provides
a variety of registration procedures
for your use.
Remember, use RegisterByte to register a byte, RegisterWord to
register a word, and so on. These procedures are in the TYPES unit.
7. RegisterConcerto
The RegisterConcerto procedure (CONCERTO.PAS) registers all of the
Concerto functions and variables with the interpreter. It also
registers many SYSTEM and CRT variables, including DirectVideo and
CheckSnow. Always call RegisterConcerto as soon as possible in
your program, and always before executing the initialization script.
BEGIN
RegisterConcerto;
Script('Init');
:
:
END;
9. The Initialization Script
The initialization script (INIT.SCR) is the DNA of the program.
It controls all aspects of the door's configuration -- everything
from the random-number generator to the activation of the FOSSIL
driver. As shown above, always call RegisterConcerto before running
the script.
m a c r o s /MACROS
──────────────────────────────────────────────────────────────────────────
A variable can be imbedded in a text file or string:
{Variable}
│ │ └─ Right delimiter
│ └──────── Variable name
└────────── Left delimiter
This is called a macro. Concerto will extract the variable name,
obtain its contents, then display the results on the screen.
Example: "Hello, {UserFirst}!" -> "Hello, Kelly!"
Example: "COM{ComPort}:" -> "COM1:"
Formatting the result to a certain length is easy:
{Variable:Size}
│ └──── Size
└────── Colon
The result will be padded or clipped to insure the desired length.
By default, the result will be right-justified. Place a negative
sign in front of the size to force left-justification:
{Variable:-Size}
└────── Negative sign to force left-justication
Examples: (UserName="Sleeping Beauty")
Hello {UserName}! --> Hello Sleeping Beauty!
Hello {UserName:10}! --> Hello Sleeping B!
Hello {UserName:20}! --> Hello Sleeping Beauty !
Hello {UserName:-20}! --> Hello Sleeping Beauty!
c o m m a n d - l i n e p a r a m e t e r s /PARAMS
──────────────────────────────────────────────────────────────────────────
Command-line parameters are defined in INIT.SCR:
GetParam B, Baud
GetParam C, ComPort
GetParam N, Node
GetParam O, Locked
GetParam P, DropFile
│ │ │
│ │ └─────────── Script variable
│ └─────────────── Flag character
└─────────────────────── Script command
Here is a typical script after a sysop's modifications:
> ;modications made when installed last december
> ;GetParam O, Locked ;comment-out this line
> GetParam L, Locked ;merely changed the flag char to L
> GetParam S, Security ;added this line cause i'm not using a dropfile
Parameters must start with a dash (-) or a forward slash (/). The
flag character is not case-sensitive. A space may exist between the
flag character and its data. Here are a few valid command lines:
Example: GAME.EXE /C 1 <-- Notice the space.
Example: GAME.EXE -s30 <-- No space here.
Example: GAME.EXE -n1 -O38400 <-- Upper and lower-case flag chars.
Example: GAME.EXE -b300 /c1 <-- Slash or dash
c o l o r s /COLORS
──────────────────────────────────────────────────────────────────────────
A color system is a protocol (or standard) for specifying a certain color.
Some color systems (like ANSI and AVATAR) provide additional services.
Most protocols, however, simply make it easy to change the current color.
All protocols have one thing in common: The Flag Character. The flag
char is the character that tells the computer that a color change
is about to occur. ANSI, for example, uses the escape character (#27).
AVATAR uses a control-v.
When Concerto encounters a flag char, it diverts the stream of outbound
characters to the driver handling that particular protocol. The driver
examines the characters, takes appropriate action, and returns control
to Concerto.
We've provided support for ANSI, AVATAR, HexPipe, LORD, RemoteAccess,
PCBoard and WildCat. The specifications for these protocols are
described in SYSOP.DOC. These protocols are installed by the
RegisterConcerto procedure.
g e t t i n g s t a r t e d /START
──────────────────────────────────────────────────────────────────────────
We've already done the following for you:
a. Drawn all external ANSI files used by Concerto. An example is
TIMEOUT.ANS, which is displayed when the caller falls asleep.
b. Provided a script library with documentation. You do not have to
worry about making the COMPORT variable accessible to the sysop.
Everything is documented in SYSOP.DOC -- which you can bundle with
your doors royalty-free.
c. Wrote a standard initialization script with lots of comments.
This script will work with 99% of all systems and 99% of all doors.
These files are located in the FREE archive. You should do the following
when starting a new door:
1. Make a separate directory for the door (ie C:\TP\MYGAME).
2. Copy the contents of archive to this directory.
3. Rename TEMPLATE.PAS to the name of your program.
4. Run TURBO.EXE or TPX.EXE from the directory.
Follow these steps and you can begin development of your game immediately.
▀▀\ ▀▀\
▀▀\ ▀▀\ Programmer's Reference Guide
▀▀▀▀▀▀\
▀▀\
▀▀\
u n i t s /UNITS
──────────────────────────────────────────────────────────────────────────
╔══════════╤═════════════════════════════════════════════════╗
║ DMenus │ Simple menu system for door games. ║
║ Errata │ Run-time error handler. ║
║ XDOS │ Extended DOS support unit. ║
║ FOSSIL │ Fido/Opus/SeaDOG Interface Layer support unit. ║
║ RA │ RemoteAccess BBS support unit. ║
║ XStrings │ Extended pChar/TPString unit. ║
║ IO │ Input/Output engine. ║
║ LORD │ Legend of the Red Dragon support unit. ║
║ Scripts │ Script interpreter. ║
║ Concerto │ Concerto Door Development Kit (central unit). ║
║ Win95 │ Windows 3.x and Windows 95 support unit. ║
║ Math │ Mathematics routines. ║
║ Reboot │ Rebooting routines. ║
║ Types │ Variable types for the script interpreter. ║
║ Video │ Variety of CGA, EGA and VGA video routines. ║
║ Slicer │ Time-slicing unit. ║
║ Sounds │ IBM PC speaker sound effects. ║
║ Keyboard │ Keyboard support unit. ║
╚══════════╧═════════════════════════════════════════════════╝
g l o b a l v a r i a b l e s /GLOBAL
──────────────────────────────────────────────────────────────────────────
Concerto uses over 100 global variables. It is unlikely, however,
that you'll use more than 10% of them. Most of them are for tweaking
purposes only.
BBS information is stored in a tBBS record (CONCERTO.TPU):
BBS : tBBS = (
Name : pChar = NIL;
SysopFirst : pChar = NIL;
SysopLast : pChar = NIL );
The chat-mode configuration is stored in a tChatCfg record (CONCERTO.TPU):
ChatCfg : tChatCfg = (
ExecPrompt : pChar = NIL;
Flags : Word = 0;
Greeting : pChar = NIL;
Goodbye : pChar = NIL;
RemoteExit : Boolean = False;
SysopColors : tColorScheme =
( Lower:03; Upper:03; Digit:03; HiBit:03; Punct:03 );
UserColors : tColorScheme =
( Lower:07; Upper:07; Digit:07; HiBit:07; Punct:07 ));
Most communications information is stored in CONCERTO.TPU:
Baud : LongInt = 0;
CarrierDropped : Boolean = False;
DropFile : pChar = NIL;
Locked : LongInt = 0;
Node : LongInt = 0;
Software information is stored in a tSoftware record (CONCERTO.TPU):
Software : tSoftware =
Application : pChar = NIL;
Author : pChar = NIL;
Build : STRING[6] = '960616';
Company : pChar = NIL;
Copyright : pChar = NIL;
Version : pChar = NIL );
User-related variables are stored in a tUser record (CONCERTO.TPU):
User : tUser = (
Expert : Boolean = False;
FirstName : pChar = NIL;
LastName : pChar = NIL;
Location : pChar = NIL;
Password : pChar = NIL;
PhoneData : pChar = NIL;
PhoneFax : pChar = NIL;
PhoneVoice : pChar = NIL;
Security : LongInt = 0);
Doors using the LORD unit (Legend of the Red Dragon support) can
access several pChars containing paths to the various LORD files:
LORDDirectory : pChar = NIL;
LORD_3rdParty : pChar = NIL; { 3RDPARTY .DAT }
LORD_BadSay : pChar = NIL; { BADSAY .DAT }
LORD_Config : pChar = NIL; { LORD .DAT }
LORD_GoodSay : pChar = NIL; { GOODSAY .DAT }
LORD_LEnemy : pChar = NIL; { LENEMY .DAT }
LORD_LockOut : pChar = NIL; { LOCKOUT .DAT }
LORD_NormSay : pChar = NIL; { NORMSAY .DAT }
LORD_Player : pChar = NIL; { PLAYER .DAT }
LORD_RIP : pChar = NIL; { LORDRIP .DAT }
LORD_Text : pChar = NIL; { LORDTXT .DAT }
The remaining variables are scattered across the units. Here are
the most important ones:
LastChar : Char = #0; (IO) Last character processed.
LastPrinted : Char = #0; (IO) Last character actually printed.
TextAttr : Byte = 0; (IO) Current text color.
TextDir : pChar = NIL; (IO) Location of text files.
TimeLeft : Word = 60; (IO) Number of minutes left.
TimeOut : Word = 180; (IO) Number of seconds before timeout.
ScanCode : Word = 0; (Keyboard) Scancode of last local keystroke.
ScriptDir : pChar = NIL; (Scripts) Location of script files.
Go to the most appropriate unit when looking for a variable or constant.
For example, suppose that you are curious about the buffer used when
loading ANSI/AVATAR files. A scan through IO.PAS will reveal the
variable TextBufSize, which specifies the size of the buffer when
loading text files for display.
The RegisterConcerto procedure creates script-variable equivilants of
many global variables -- including variables in some of the Borland
units (CRT, SYSTEM, etc). Scan SYSOP.DOC or CONCERTO.PAS for details.
f o r m a t /FORMAT
──────────────────────────────────────────────────────────────────────────
Name (Unit)
PURPOSE : The purpose of this function or procedure.
NOTES : Important nodes, more details, warnings, etc.
EXAMPLE : Example code that uses this function or procecure.
SEE ALSO : Other functions or procedures that you may wish to examine.
l i b r a r y /LIBRARY
──────────────────────────────────────────────────────────────────────────
PROCEDURE ActivateAll; (IO)
PURPOSE : Activates every I/O driver.
NOTES : This procedure is generally used after you have temporarily
suspended one or more of the drivers (such as when displaying a
sysop-only screen).
EXAMPLE : PROCEDURE PrivateMessageToCaller(p:pIODriverRemote; Msg:pChar);
BEGIN
DeactivateAllExceptPtr(p);
SO_pCharLn(Msg);
ActivateAll;
END;
SEE ALSO : DeactivateAllExceptPtr
FUNCTION AddSysKey(Code:Word; Source:pChar):Boolean; (Concerto)
PURPOSE : Associates a scan code with a string of commands.
NOTES : Concerto will compare each local keystroke with the list of
scan codes registered with this function. The commands
are executed if a match is found. A list of common scan
codes can be found in SYSOP.DOC and KEYBOARD.INT.
EXAMPLE : BEGIN
WriteLn('WARNING: The initialization file was not found!');
WriteLn(' The program will use default values.');
AddSysKey(KB_Alt_C,'Chat');
AddSysKey(KB_Alt_H,'HangUp Exit 0');
AddSysKey(KB_Alt_X,'Exit 0');
:
etc
:
END;
FUNCTION AllDigits(p:pChar):Boolean; (XStrings)
PURPOSE : Returns TRUE if the all of the characters are digits.
NOTES : This function is merely a wrapper for AllInSet.
SEE ALSO : AllInSet, CountDigits
FUNCTION AllInSet(p:pChar; List:CharSet):Boolean; (XStrings)
PURPOSE : Returns TRUE if all of the characters in the string
are in the given character set.
SEE ALSO : AllDigits
PROCEDURE Allocate_CRC16_Table(VAR p:pCRC16_Table); (XStrings)
PURPOSE : Generates a 16-bit CRC table for future calculations.
SEE ALSO : Allocate_CRC32_Table
PROCEDURE Allocate_CRC32_Table(VAR p:pCRC32_Table); (XStrings)
PURPOSE : Generates a 32-bit CRC table for future calculations.
SEE ALSO : Allocate_CRC16_Table
FUNCTION ANSI_SYS_Driver:Boolean; (Video)
PURPOSE : Returns TRUE is ANSI.SYS is loaded on the local machine.
FUNCTION AppendChr(p:pChar; c:Char):pChar; (XStrings)
PURPOSE : Appends a character to a string.
NOTES : No range checking is performed.
FUNCTION AppendSlash(p:pChar):pChar; (XDOS)
PURPOSE : Appends a slash to the directory name.
NOTES : A slash is not appended if the string is empty. An empty
directory path generally implies the current directory, not
the root directory.
FUNCTION Area_Circle(CONST Radius:Float):Float; (Math)
PURPOSE : Calculates the area of a circle with the specified radius.
NOTES : Area = πr²
SEE ALSO : Area_Ellipse, Area_Equilateral_Triangle, Area_Rectangle,
Area_Sector, Area_Square, Area_Trapezoid, Area_Triangle
FUNCTION Area_Ellipse(CONST R1,R2:Float):Float; (Math)
PURPOSE : Calculates the area of an ellipse with the specified focal
points.
SEE ALSO : Area_Circle, Area_Equilateral_Triangle, Area_Rectangle,
Area_Sector, Area_Square, Area_Trapezoid, Area_Triangle
FUNCTION Area_Equilateral_Triangle(CONST S:Float):Float; (Math)
PURPOSE : Calculates the area of an equilateral triangle with the
given side length.
√ 3
NOTES : Area = ─── S²
4
SEE ALSO : Area_Circle, Area_Ellipse, Area_Rectangle, Area_Sector,
Area_Square, Area_Trapezoid, Area_Triangle
FUNCTION Area_Rectangle(CONST X,Y:Float):Float; (Math)
PURPOSE : Calculates the area of a rectangle with the specified side
lengths.
SEE ALSO : Area_Circle, Area_Ellipse, Area_Equilateral_Triangle,
Area_Sector, Area_Square, Area_Trapezoid, Area_Triangle
FUNCTION Area_Sector(CONST Radius, Angle:Float):Float; (Math)
PURPOSE : Calculates the area of a sector with the specified radius
and angle.
SEE ALSO : Area_Circle, Area_Ellipse, Area_Equilateral_Triangle,
Area_Rectangle, Area_Square, Area_Trapezoid, Area_Triangle
FUNCTION Area_Square(CONST Side:Float):Float; (Math)
PURPOSE : Calculates the area of a square with the specified side length.
NOTES : Area = S²
SEE ALSO : Area_Circle, Area_Ellipse, Area_Equilateral_Triangle,
Area_Rectangle, Area_Sector, Area_Trapezoid, Area_Triangle
FUNCTION Area_Trapezoid(CONST A,B,H:Float):Float; (Math)
PURPOSE : Calculates the area of a trapezoid with the specified
top, base and height.
SEE ALSO : Area_Circle, Area_Ellipse, Area_Equilateral_Triangle,
Area_Rectangle, Area_Sector, Area_Square, Area_Triangle
FUNCTION Area_Triangle(CONST Base,Height:Float):Float; (Math)
PURPOSE : Calculates the area of a triangle with the specified base
and height lengths.
NOTES : Area = ½BH
SEE ALSO : Area_Circle, Area_Ellipse, Area_Equilateral_Triangle,
Area_Rectangle, Area_Sector, Area_Square, Area_Triangle
FUNCTION Calculate_CRC16(p:pChar):Word; (XStrings)
PURPOSE : Calculates the 16-bit CRC of the string.
SEE ALSO : Calculate_CRC16I, Calculate_CRC32, Calculate_CRC32I
FUNCTION Calculate_CRC16I (p:pChar):Word; (XStrings)
PURPOSE : Calculates the 16-bit CRC of the string without
case-sensitivity.
SEE ALSO : Calculate_CRC16, Calculate_CRC32, Calculate_CRC32I
FUNCTION Calculate_CRC32 (p:pChar):LongInt; (XStrings)
PURPOSE : Calculates the 32-bit CRC of the string.
SEE ALSO : Calculate_CRC16, Calculate_CRC16I, Calculate_CRC32I
FUNCTION Calculate_CRC32I (p:pChar):LongInt; (XStrings)
PURPOSE : Calculates the 32-bit CRC of the string without
case-sensitivity.
SEE ALSO : Calculate_CRC16, Calculate_CRC16I, Calculate_CRC32
PROCEDURE Capitalize(VAR s:OpenString); (XStrings)
PURPOSE : Capitalizes a Turbo Pascal string.
PROCEDURE ChangeDirectory(Dir:pChar); (XDOS)
PURPOSE : Changes to the specified directory.
NOTES : The result is saved in DOSError.
PROCEDURE ChangeDrive(Drive:Byte); (XDOS)
PURPOSE : Changes to the specified drive.
NOTES : 1 = Drive A
2 = Drive B
3 = Drive C
4 = Drive D
etc...
SEE ALSO : CurrentDrive
FUNCTION Char_pChar(p:pChar; c:Char):pChar; (XStrings)
PURPOSE : Converts a character to a string.
NOTES : The destination must have enough room to hold the character
and the terminating null-zero.
PROCEDURE CheckLocalMode; (Concerto)
PURPOSE : Prompts the sysop for his first and last name if the door
is operating independently of a BBS system.
NOTES : The user will not be prompted if any of the following is true:
1. The door is running remotely.
2. A drop file has been specified.
3. User.FirstName is not NIL.
4. User.LastName is not NIL.
If executed, the file LOCAL.ANS is displayed to the caller.
FUNCTION Circum_Circle(CONST R:Float):Float; (Math)
PURPOSE : Calculates the circumference of a circle with the given radius.
SEE ALSO : Circum_Ellipse
FUNCTION Circum_Ellipse(CONST R1,R2:Float):Float; (Math)
PURPOSE : Calculates the circumference of an ellipse with the given
major and minor radii.
SEE ALSO : Circum_Circle
FUNCTION Clip(p:pChar; SetSize:Integer; Filler:Char):pChar; (XStrings)
PURPOSE : Clips or pads the string to a given size.
NOTES : ■ SetSize < 0 : The string is left-justified.
■ SetSize > 0 : The string is right-justified.
■ SetSize = 0 : NOP (no operation).
The string length cannot exceed 32767 characters.
SEE ALSO : Delete
PROCEDURE CloseClipboard; (Win95)
PURPOSE : Closes the Windows clipboard.
EXAMPLE : PROCEDURE WriteFirstNameToClipBoard;
BEGIN
OpenClipboard;
SetClipBoardDate(User.FirstName);
CloseClipboard;
END;
SEE ALSO : EmptyClipboard, OpenClipboard
PROCEDURE ColdReboot; (Reboot)
PURPOSE : Invokes a cold reboot.
NOTES : A cold reboot is the same as a full reset of the computer
computer system. Compare this to the warm reboot, which
generally skips the initial memory test.
EXAMPLE : BEGIN
SO_pCharLn('Please prepare for a system reboot.');
IF SI_Boolean('Skip initial memory test? ',False) THEN
WarmReboot
ELSE
ColdReboot;
END;
SEE ALSO : RebootComputer, HardwareReset, WarmReboot
FUNCTION CorrectPathName(Dest,Raw,Dir,Ext:pChar):pChar; (XDOS)
PURPOSE : Generates a string with the proper directory and extension.
PARAMS : Dest Destination string.
Raw Filespec to process.
Dir Default directory is one was not specified.
Ext Default extension is one was not specified.
NOTES : No range checking is performed.
FUNCTION COSH(CONST R:Float):Float; (Math)
PURPOSE : Calculates the hyperbolic cosine of the argument.
SEE ALSO : COTH, SECH, SINH, TANH
FUNCTION COT(CONST R:Float):Float; (Math)
PURPOSE : Calculates the cotangent of the argument.
SEE ALSO : CSC, SEC, TAN
FUNCTION COTH(CONST R:Float):Float; (Math)
PURPOSE : Calculates the hyperbolic cotangent of the argument.
SEE ALSO : COSH, SECH, SINH, TANH
FUNCTION CountDigits(n:LongInt):Byte; (XStrings)
PURPOSE : Returns the size of the string representation of the number,
not including the positive or negative sign.
SEE ALSO : AllDigits
FUNCTION CSC(CONST R:Float):Float; (Math)
PURPOSE : Calculates the cosecant of the argument.
SEE ALSO : COT, SEC, TAN
FUNCTION CurrentDay:Byte; (XDOS)
PURPOSE : Returns the current day number of the month.
SEE ALSO : CurrentMonth, CurrentWeekday, CurrentYear
FUNCTION CurrentDrive:Byte; (XDOS)
PURPOSE : Returns the current disk drive number (1=A, 2=B, 3=C, etc).
SEE ALSO : ChangeDrive
FUNCTION CurrentHours:Byte; (XDOS)
PURPOSE : Returns the current hour.
SEE ALSO : CurrentMinutes, CurrentSeconds, GetDate
FUNCTION CurrentMinutes:Byte; (XDOS)
PURPOSE : Returns the current number of minutes.
SEE ALSO : CurrentHours, CurrentSeconds, GetDate
FUNCTION CurrentMonth:Byte; (XDOS)
PURPOSE : Returns the current month number (1-12).
SEE ALSO : CurrentDay, CurrentWeekday, CurrentYear
FUNCTION CurrentSeconds:Byte; (XDOS)
PURPOSE : Returns the current number of seconds.
SEE ALSO : CurrentHours, CurrentMinutes, GetDate
FUNCTION CurrentWeekday:Byte; (XDOS)
PURPOSE : Returns the current day of week (0-6).
NOTES : 0 = Sunday
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday
SEE ALSO : CurrentDay, CurrentMonth, CurrentYear
FUNCTION CurrentYear:Word; (XDOS)
PURPOSE : Returns the current year (1980-2099).
SEE ALSO : CurrentDay, CurrentMonth, CurrentWeekday
PROCEDURE CursorOff; (Video)
PURPOSE : Disables the visibility of the cursor without affecting
its attributes (i.e. size). Very old BIOSs are supported.
SEE ALSO : CursorOn, SetCursorShape
PROCEDURE CursorOn; (Video)
PURPOSE : Enables the visibility of the cursor without affecting
its attributes (i.e. size). Very old BIOSs are supported.
SEE ALSO : CursorOff, SetCursorShape
FUNCTION DayExtension(p:pChar; Day:Byte):pChar; (XStrings)
PURPOSE : Returns the two-character extension of the day number.
NOTES : The destination must contain enough room to hold two
characters. The day number cannot exceed 31. The result
will be 'st', 'nd', 'rd' or 'th'.
PROCEDURE DeactivateAllExceptPtr(p:pIODriver); (IO)
PURPOSE : Deactivates a specific I/O driver.
NOTES : The driver is suspended, not deallocated.
EXAMPLE : PROCEDURE PrivateMessageToCaller(p:pIODriverRemote; Msg:pChar);
BEGIN
DeactivateAllExceptPtr(p);
SO_pCharLn(Msg);
ActivateAll;
END;
SEE ALSO : ActivateAll
FUNCTION DecTimeLeft(n:Word):Word; (IO)
PURPOSE : Decreases the number of minutes remaining in the session.
SEE ALSO : IncTimeLeft
FUNCTION DefaultExtension(Path,DefExt:pChar):pChar; (XDOS)
PURPOSE : Ensures that the specified file has the proper extension.
PROCEDURE DefaultNoTimeProcedure; (Concerto)
PURPOSE : Convenience. Use this procedure if you do not wish to
write your own no-time-left procedure.
NOTES : The file EXCEEDED is displayed before terminating the call.
Add the following to your main program:
SetNoTimeProcedure(@DefaultNoTimeProcedure);
SEE ALSO : SetNoTimeProcedure
PROCEDURE DefaultTimeOutProcedure; (Concerto)
PURPOSE : Convenience. Use this procedure if you do not wish to
write your own time-out procedure.
NOTES : The file TIMEOUT.ANS is displayed before terminating the
call. Add the following to your main program:
SetTimeOutProcedure(@DefaultTimeOutProcedure)
SEE ALSO : SetTimeOutProcedure
FUNCTION Deg_Grd (CONST D:Float) : Float; (Math)
PURPOSE : Converts degrees to gradians.
SEE ALSO : Deg_Rad, Grd_Deg, Grd_Rad, Rad_Deg, Rad_Grd
FUNCTION Deg_Rad (CONST D:Float) : Float; (Math)
PURPOSE : Converts degrees to radians.
SEE ALSO : Deg_Grd, Grd_Deg, Grd_Rad, Rad_Deg, Rad_Grd
PROCEDURE DeleteFile(Path:pChar); (XDOS)
PURPOSE : Deletes the specified file.
NOTES : The result is saved in DOSError.
PROCEDURE DeleteID(p:pChar); (Scripts)
PURPOSE : Deletes the identifier.
NOTES : The name of the identifier is not case-sensitive.
FUNCTION DesqView:Boolean; (Slicer)
PURPOSE : Returns TRUE if DesqView is installed, FALSE if not.
SEE ALSO : DOSShell, DoubleDOS, OS2, TopView, Windows, Windows_Real
FUNCTION DesqView_Version:Word; (Slicer)
PURPOSE : Returns the version of DesqView.
NOTES : The major version is returned in the low byte; the minor
version is returned in the high byte. This function properly
handles the version bug found in some early copies of
DesqView 2.0.
SEE ALSO : DOS_Version, DoubleDOS_Version, OS2_Version,
TopView_Version, Windows_Version
FUNCTION DiskFree(Drive:Byte):LongInt; (XDOS)
PURPOSE : Returns the number of free bytes on the specified drive.
NOTES : 0=default, 1=A, 2=B, etc. Returns -1 if an invalid drive
was specified.
SEE ALSO : DiskSize
FUNCTION DiskSize(Drive:Byte):LongInt; (XDOS)
PURPOSE : Returns the size in bytes of the specified drive.
NOTES : 0=default, 1=A, 2=B, etc. Returns -1 if an invalid drive
was specified.
SEE ALSO : DiskFree
FUNCTION Distance(X1,Y1,X2,Y2:Float):Float; (Math)
PURPOSE : Calculates the distance between two points.
FUNCTION DoorSys_2_Graphics(p:pChar):Byte; (Video)
PURPOSE : Converts a DOOR.SYS graphics string to the system used by
this unit.
NOTES : NG = 0 (_ASCII)
GR = 1 (_ANSI)
FUNCTION DOSLocation:Word; (XDOS)
PURPOSE : Describes the location of DOS.
NOTES : Use the dmXXXX constants to determine the location of DOS.
EXAMPLE : BEGIN
SO_pChar('RAM/ROM Check: ');
IF (DOSLocation AND dmRAM) = dmRAM THEN
SO_pCharLn('DOS is located in RAM')
ELSE
IF (DOSLocation AND dmROM) = dmROM THEN
SO_pCharLn('DOS is located in ROM');
SO_pChar('Hgh/Cnv Check: ');
IF (DOSLocation AND dmConv) = dmConv THEN
SO_pCharLn('DOS is located in conventional memory')
ELSE
IF (DOSLocation AND dmHigh) = dmHigh THEN
SO_pCharLn('DOS is located in high memory');
END;
FUNCTION DOSShell:Boolean; (Slicer)
PURPOSE : Returns TRUE if the DOS 5+ task switcher is loaded.
SEE ALSO : DesqView, DoubleDOS, OS2, TopView, Windows, Windows_Real
FUNCTION DOSVersion:Word; (XDOS)
PURPOSE : Returns the DOS version number.
NOTES : The low byte is the major version. The high byte is the
minor version.
PROCEDURE DOS_Release; (Slicer)
PURPOSE : Notifies DOS that the program is idle.
SEE ALSO : Release, DoubleDOS_Release, TopView_Release, Windows_Release
FUNCTION DOS_Version:Word; (Slicer)
PURPOSE : Returns the version of DOS on the local computer.
NOTES : The major version is returned in the low byte; the minor
version is returned in the high byte.
SEE ALSO : DesqView_Version, DoubleDOS_Version, OS2_Version,
TopView_Version, Windows_Version
FUNCTION DoubleDOS:Boolean; (Slicer)
PURPOSE : Returns TRUE is DoubleDOS is installed, FALSE if not.
SEE ALSO : DesqView, DOSShell, OS2, TopView, Windows, Windows_Real
PROCEDURE DoubleDOS_CriticalBegin; (Slicer)
PURPOSE : Disables multitasking in DoubleDOS.
SEE ALSO : DoubleDOS_CriticalEnd
PROCEDURE DoubleDOS_CriticalEnd; (Slicer)
PURPOSE : Enables multitasking in DoubleDOS.
SEE ALSO : DoubleDOS_CriticalBegin
PROCEDURE DoubleDOS_Release; (Slicer)
PURPOSE : Releases a single 55 ms timeslice back to DoubleDOS
SEE ALSO : Release, DOS_Release, TopView_Release, Windows_Release
FUNCTION DoubleDOS_Version:Word; (Slicer)
PURPOSE : This dummy function always returns 0. Please contact
the author if you have technical information on the
DoubleDOS multitasker.
SEE ALSO : DesqView_Version, DOS_Version, OS2_Version,
TopView_Version, Windows_Version
FUNCTION EGA_BIOS:Boolean; (Video)
PURPOSE : Returns TRUE if an EGA-compatible BIOS is detected.
SEE ALSO : VGA_Detected
PROCEDURE EmptyClipboard; (Win95)
PURPOSE : Empties the Windows clipboard.
EXAMPLE : BEGIN
OpenClipboard
EmptyClipboard
CloseClipboard
END;
SEE ALSO : CloseClipboard, OpenClipboard
FUNCTION EnsureDOS7:Boolean; (Win95)
PURPOSE : Returns TRUE if the local operating system is MS-DOS 7.0
(Windows 95) or later. Returns FALSE for all earlier versions.
FUNCTION Execute(Source:pChar):Word; (Scripts)
PURPOSE : Interpreters the string of commands.
SEE ALSO : Script
PROCEDURE ExitChatMode; (Concerto)
PURPOSE : Terminates the chat-mode, if active.
NOTES : You may also directly modify the ChatExit flag of the
ChatFlags variable:
ChatCfg.Flags := (ChatCfg.Flags OR ChatExit);
Or:
ASM
OR ChatCfg.Flags, ChatExit
END;
SEE ALSO : LineChat
PROCEDURE ExitDoor(ErrorLevel:Byte); (Concerto)
PURPOSE : Exits the door with the specified error level.
NOTES : The connection is not terminated. Use the HangUp function
if you wish to drop carrier on the user.
EXAMPLE : BEGIN
SO_pCharLn('Sysop! You have elected to return to the BBS.');
IF SI_Boolean('Hang up on the caller? ',False) THEN
HangUp;
ExitDoor(0);
END;
SEE ALSO : HangUp
FUNCTION ExtractNames(p:pChar; VAR First,Last:pChar):pChar; (XStrings)
PURPOSE : Extracts the first and last names from a string.
WARNING : No error or range checking! Do not use in uncontrolled
enviroments or risk a system crash!
FUNCTION Factorial(N:LongInt):LongInt; (Math)
PURPOSE : Calculates the factorial of N (N!).
NOTES : This function does not use recursion; it is, however, limited
by the capacity of a LongInt (MaxLongInt).
SEE ALSO : nCr, nPr
PROCEDURE FadeIn(d:Word); (Video)
PURPOSE : Restores a previously faded screen (via FadeOut).
NOTES : An EGA/VGA graphics card is required. This procedure works
in text mode.
SEE ALSO : FadeOut
PROCEDURE FadeOut(d:Word); (Video)
PURPOSE : Smoothly cycles the color palette to produce a smooth
fade-out effect.
NOTES : An EGA/VGA graphics card is required. This procedure works
in text mode. The fade will not be smooth if executed
in a windowed-DOS box under many multitaskers.
SEE ALSO : FadeIn
FUNCTION FileExist(Path:pChar):Boolean; (XDOS)
PURPOSE : Returns TRUE if the specified file actually exists.
FUNCTION FileSplit(Path, Dir, Name, Ext:pChar):Word; (XDOS)
PURPOSE : Splits the path into its three components.
NOTES : Use fcXXXX to analyze the results.
FUNCTION ForceFalse:Boolean; (Slicer)
PURPOSE : Always returns FALSE.
SEE ALSO : ForceTrue, NullProc
FUNCTION ForceTrue:Boolean; (Slicer)
PURPOSE : Always returns TRUE.
SEE ALSO : ForceFalse, NullProc
FUNCTION FormattedBaud(p:pChar; Baud:LongInt):pChar; (XStrings)
PURPOSE : Returns a formatted version of the baud rate.
NOTES : The destination must have enough room to retain 4 characters
plus the terminating null-zero.
Baud Result Baud Result
────────────────────────────────────────────
0 Zero 300 Slow
1200 1200 2400 2400
4800 4800 7200 7200
9600 9600 12000 12.0
14400 14.4 16800 16.8
19200 19.2 21600 21.6
24000 24.0 26400 26.4
28800 28.8 38400 38.4
57600 57.6 64000 64.0
Greater c²
PROCEDURE FOSSIL_ANSI_Write(C:Char); (FOSSIL)
PURPOSE : Sends a character to the local screen in such a way that
ANSI processing can occur (if available).
NOTES : Never call this procedure is DOS output cannot be used.
SEE ALSO : FOSSIL_BIOS_Write
PROCEDURE FOSSIL_BIOS_Write(C:Char); (FOSSIL)
PURPOSE : Sends a character to the local screen using BIOS I/O routines.
NOTES : DOS I/O is not used.
SEE ALSO : FOSSIL_ANSI_Write
FUNCTION FOSSIL_Block_Write(FOSSIL_Port, Bytes:Word; Data:Pointer):Word; (FOSSIL)
PURPOSE : Copies data from your buffer to the outbound buffer.
NOTES : This function is substantially faster than a
series of FOSSIL_Xmit_Chr calls.
SEE ALSO : FOSSIL_Xmit_Chr, FOSSIL_Xmit_Str
FUNCTION FOSSIL_Carrier_Detect(FOSSIL_Port:Word):Boolean; (FOSSIL)
PURPOSE : Returns TRUE if a caller is online; FALSE if not.
FUNCTION FOSSIL_Char_Waiting(FOSSIL_Port:Word):Boolean; (FOSSIL)
PURPOSE : Returns TRUE if a character is waiting in the inbound buffer.
SEE ALSO : FOSSIL_Read_Chr
PROCEDURE FOSSIL_DeInit(FOSSIL_Port:Word); (FOSSIL)
PURPOSE : Deinitializes the FOSSIL driver.
NOTES : You should call this procedure when exiting the program.
DTR is not affected (carrier is not dropped).
SEE ALSO : FOSSIL_Init
PROCEDURE FOSSIL_Flush_Output(FOSSIL_Port:Word); (FOSSIL)
PURPOSE : Transmits any data still in the outbound buffer.
NOTES : Control will not be returned until all of the data has been
sent.
SEE ALSO : FOSSIL_Purge_Input, FOSSIL_Purge_Output
PROCEDURE FOSSIL_GotoXY(X,Y:Byte); (FOSSIL)
PURPOSE : Positions the cursor on the local computer.
NOTES : The upper-left corner is position (1,1).
SEE ALSO : FOSSIL_WhereX, FOSSIL_WhereY
FUNCTION FOSSIL_Init(FOSSIL_Port:Word):Boolean; (FOSSIL)
PURPOSE : Initializes the FOSSIL driver.
NOTES : The function must be called before any other communications
routines are called. Returns TRUE if a FOSSIL driver is
installed; FALSE if one was not detected.
SEE ALSO : FOSSIL_DeInit
PROCEDURE FOSSIL_Lower_DTR(FOSSIL_Port:Word); (FOSSIL)
PURPOSE : Lowers the DTR line to the modem.
SEE ALSO : FOSSIL_Raise_DTR
FUNCTION FOSSIL_Peek(FOSSIL_Port:Word):Char; (FOSSIL)
PURPOSE : Returns the next character in the inbound buffer without
removing that character from the buffer.
NOTES : FFh (#255) is returned if no characters are in the buffer.
SEE ALSO : FOSSIL_Read_Chr
PROCEDURE FOSSIL_Purge_Input(FOSSIL_Port:Word); (FOSSIL)
PURPOSE : Discards any data in the inbound buffer.
SEE ALSO : FOSSIL_Flush_Output, FOSSIL_Purge_Output
PROCEDURE FOSSIL_Purge_Output(FOSSIL_Port:Word); (FOSSIL)
PURPOSE : Discards any data in the outbound buffer.
SEE ALSO : FOSSIL_Flush_Output, FOSSIL_Purge_Input
PROCEDURE FOSSIL_Raise_DTR(FOSSIL_Port:Word); (FOSSIL)
PURPOSE : Raises the DTR line to the modem.
SEE ALSO : FOSSIL_Lower_DTR
PROCEDURE FOSSIL_Read_Chr(FOSSIL_Port:Word; VAR C:Char); (FOSSIL)
PURPOSE : Reads a character from the FOSSIL driver.
NOTES : The procedure will not return until a character is available
in the inbound buffer.
SEE ALSO : FOSSIL_Char_Waiting, FOSSIL_Peek, FOSSIL_Xmit_Chr
PROCEDURE FOSSIL_Reboot_Cold; (FOSSIL)
PURPOSE : Reboots the computer.
NOTES : A cold reboot includes the power-on memory test; a warm
reboot does not. This procedure may fail under a
multitasker.
SEE ALSO : FOSSIL_Reboot_Warm
PROCEDURE FOSSIL_Reboot_Warm; (FOSSIL)
PURPOSE : Reboots the computer.
NOTES : A cold reboot includes the power-on memory test; a warm
reboot does not. This procedure may fail under a
multitasker.
SEE ALSO : FOSSIL_Reboot_Cold
PROCEDURE FOSSIL_Set_Baud(FOSSIL_Port:Word; Code:Byte); (FOSSIL)
PURPOSE : Sets the baud rate for the specified port.
NOTES : 000 00 0 00
│ │ │ └─ Character length
│ │ └──── Stop bits
│ └────── Parity
└───────── Baud rate
Refer to MakeBaudCode for an explanation of these bits.
SEE ALSO : MakeBaudCode
PROCEDURE FOSSIL_Watchdog(FOSSIL_Port:Word; Watch:Boolean); (FOSSIL)
PURPOSE : Enables or disables a carrier watchdog function.
NOTES : The watchdog will reboot the system if the caller drops the
connection. This allows the BBS or front-end mailer to regain
control of the system (via AUTOEXEC.BAT). This function
may not work under a multitasker.
SEE ALSO : FOSSIL_Reboot_Cold, FOSSIL_Reboot_Warm
FUNCTION FOSSIL_WhereX:Byte; (FOSSIL)
PURPOSE : Returns the horizontal position of the cursor.
NOTES : The upper-left corner is position (1,1).
SEE ALSO : FOSSIL_GotoXY, FOSSIL_WhereY
FUNCTION FOSSIL_WhereY:Byte; (FOSSIL)
PURPOSE : Returns the vertical position of the cursor.
NOTES : The upper-left corner is position (1,1).
SEE ALSO : FOSSIL_GotoXY, FOSSIL_WhereX
PROCEDURE FOSSIL_Xmit_Chr(FOSSIL_Port:Word; C:Char); (FOSSIL)
PURPOSE : Transmits a character.
NOTES : The procedure will not return until there is room in the
outbound buffer.
SEE ALSO : FOSSIL_Block_Write, FOSSIL_Read_Chr, FOSSIL_Xmit_Chr_No_Wait,
FOSSIL_Xmit_Str
FUNCTION FOSSIL_Xmit_Chr_No_Wait(FOSSIL_Port:Word; C:Char):Boolean; (FOSSIL)
PURPOSE : Attempts to transmit a character.
NOTES : The function returns TRUE if room was available in the
outbound buffer; FALSE if not.
SEE ALSO : FOSSIL_Block_Write, FOSSIL_Xmit_Chr, FOSSIL_Xmit_Str
FUNCTION FOSSIL_Xmit_Str(FOSSIL_Port:Word; CONST S:OpenString):Word; (FOSSIL)
PURPOSE : Sends a Turbo Pascal string to the FOSSIL driver.
SEE ALSO : FOSSIL_Block_Write, FOSSIL_Xmit_Chr
FUNCTION GCF(N1,N2:LongInt):LongInt; (Math)
PURPOSE : Calculates the greatest common factor of two integers.
SEE ALSO : LCM
PROCEDURE GenerateRebootCom(p:pChar); (Reboot)
PURPOSE : Generates a COM (executable) file that will invoke a hardware
reset of the CPU.
NOTES : Such a program may be useful if your door uses any external
batch files (i.e. add-on modules) and you wish to give the
sysop the option of rebooting the computer in the event of an
emergency.
This command is very dangerous. Use with care.
EXAMPLE : PROCEDURE MakeBatch;
VAR
Batch : Text;
BEGIN
GenerateRebootCom('REBOOT.COM');
Assign(Batch,'RunIGM.Bat');
Rewrite(Batch);
WriteLn(Batch);
WriteLn(Batch,'REM This is a temporary batch file created');
WriteLn(Batch,'REM by the door when running an IGM. You');
WriteLn(Batch,'REM may safely delete this file if the door');
WriteLn(Batch,'REM is shut down on all nodes.');
WriteLn(Batch);
WriteLn(Batch,'IF %1~ = ~ GOTO Done');
WriteLn(Batch,'%2.EXE %3 %4 %5);
WriteLn(Batch,'IF ERRORLEVEL 69 REBOOT.COM
WriteLn(Batch,':Done');
WriteLn(Batch,'IF FILE EXIST REBOOT.COM DEL REBOOT.COM');
Close(Batch);
END;
SEE ALSO : RebootComputer
FUNCTION GetBIOSEquipmentList:Word; (XDOS)
PURPOSE : Returns the BIOS equipment list word.
FEDCBA98 76543210
00000000 00000000
││││││││ │││││││└─ 0 Floppy disk(s) installed
││││││││ ││││││└── 1 80x87 coprocessor installed
││││││││ ││││└┴─── 3 Number of 16K banks of RAM on motherboard (PC)
││││││││ ││││││ Number of 64K banks of RAM on motherboard (XT)
││││││││ ││││└┴─── 3 Unused (PS)
││││││││ ││└┴───── 5 Initial video mode
││││││││ ││ 00 EGA, VGA or PGA
││││││││ ││ 01 40x25 color
││││││││ ││ 10 80x25 color
││││││││ ││ 11 80x25 monochrome
││││││││ └┴─────── 7 Number of floppies minus 1, if bit 0 is set
│││││││└────────── 8 DMA support installed (PCjr, Tandy 1400LT)
│││││││ DMA support not installed (Tandy 1000s)
││││└┴┴─────────── B Number of serial ports installed
│││└────────────── C Game port installed
││└─────────────── D Serial printer attached (PCjr)
││ Internal modem installed (PC/Convertible)
└┴──────────────── F Number of parallel ports installed
PROCEDURE GetCBreak(VAR Break:Boolean); (XDOS)
PURPOSE : Returns the control-breaking status of DOS.
NOTES : If CBreak is off, DOS checks for a ctl-break only during
I/O. When on, DOS checks for a ctl-break at every system call.
SEE ALSO : SetCBreak
PROCEDURE GetDate(VAR Year, Month, Day, DayOfWeek: Word); (XDOS)
PURPOSE : Returns the current date of the operating system.
SEE ALSO : CurrentHours, CurrentMinutes, CurrentSeconds, SetDate
FUNCTION GetDTA:Pointer; (XDOS)
PURPOSE : Returns a pointer to the DOS data exchange buffer (DTA).
NOTES : By default, the DTA address has the offset PSP+80h and
a size of 128 bytes. DTA is used to access files using FCBs.
FUNCTION GetEnvVar(VarName:pChar):pChar; (XDOS)
PURPOSE : Returns a pointer to the value of an enviroment variable.
PROCEDURE GetIntVec(IntNo:Byte; VAR Vector: Pointer); (XDOS)
PURPOSE : Returns the vector pointer for the specified interrupt.
SEE ALSO : SetIntVec
FUNCTION GetOverscan:Byte; (Video)
PURPOSE : Returns the current color of the overscan box.
NOTES : The overscan box is the (usually) dark area surrounding the
video screen. Although programs may not write text or
graphics to this area, it is possible to change its color.
SEE ALSO : SetOverscan
FUNCTION GetProgDir(VAR p:pChar):pChar; (XDOS)
PURPOSE : Returns the directory of the EXE file.
FUNCTION GetShiftFlags:Byte; (Keyboard)
PURPOSE : Returns the status of the control keys on the keyboard.
NOTES : 76543210
│││││││└ Right shift
││││││└─ Left shift
│││││└── Control
││││└─── Alt
│││└──── Scroll lock
││└───── Num lock
│└────── Caps lock
└─────── Insert
SEE ALSO : KeyPressed, ReadKey
FUNCTION GetSwitchChar:Char; (XDOS)
PURPOSE : Returns the default DOS command-line switch character.
NOTES : FFh is returned if this function is not supported by the
DOS version on the computer.
SEE ALSO : SetSwitchChar
PROCEDURE GetTime(VAR Hour, Minute, Second, Sec100: Word); (XDOS)
PURPOSE : Obtains the current time of the operating system.
PROCEDURE GetVerify(VAR Verify:Boolean); (XDOS)
PURPOSE : Obtains the DOS verify status.
NOTES : If on, disk writes are verified to ensure proper writing.
SEE ALSO : SetVerify
FUNCTION GetVideoMode:Byte; (Video)
PURPOSE : Returns the current video mode.
SEE ALSO : SetVideoMode
FUNCTION Grd_Deg (CONST G:Float) : Float; (Math)
PURPOSE : Converts gradians to degrees.
SEE ALSO : Deg_Grd, Deg_Rad, Grd_Rad, Rad_Deg, Rad_Grd
FUNCTION Grd_Rad (CONST G:Float) : Float; (Math)
PURPOSE : Converts gradians to radians.
SEE ALSO : Deg_Grd, Deg_Rad, Grd_Deg, Rad_Deg, Rad_Grd
FUNCTION HangUp:Boolean; (Concerto)
PURPOSE : Hangs up on the caller.
NOTES : The door is not terminated. Use ExitDoor if you wish to
return to the BBS.
SEE ALSO : ExitDoor
PROCEDURE HardwareReset; (Reboot)
PURPOSE : Uses the 8042 keyboard controller chip to invoke a CPU reset.
This procedure requires a 286+ and an enhanced keyboard.
NOTES : This procedure will bypass your operating system. All
concurrent tasks will be lost. Be sure to warn the operator
before using this (or any other) reboot procedure.
EXAMPLE : BEGIN
IF System.Test8086 > 0 THEN
HardwareReset
ELSE
WriteLn('Error: 286+ not detected.');
END;
SEE ALSO : RebootComputer, ColdReboot, WarmReboot
FUNCTION HexByte(c:Char):Byte; (XStrings)
PURPOSE : Concerts a hexadecimal character to a byte.
NOTES : Valid characters are 0 to 9, A to F and a to f.
Hex Dec Hex Dec
0 0 8 8
1 1 9 9
2 2 A 10
3 3 B 11
4 4 C 12
5 5 D 13
6 6 E 14
7 7 F 15
SEE ALSO : HexInt
FUNCTION HexInt(p:pChar):LongInt; (XStrings)
PURPOSE : Converts a hexadecimal string to a longint.
NOTES : Valid characters are 0 to 9, A to F and a to f.
SEE ALSO : HexByte
PROCEDURE HideStatusLine; (Concerto)
PURPOSE : Hides the current status line, if visible.
NOTES : Each status line is an identifier stored in the IDs collection.
The ShowStatus variable contains the index of the visible
status line's object in IDs, or -1 is no status line is
visible.
SEE ALSO : ShowStatusLine
FUNCTION IncTimeLeft(n:Word):Word; (IO)
PURPOSE : Increases the number of minutes remaining in the session.
SEE ALSO : DecTimeLeft
FUNCTION InDOS:Boolean; (XDOS)
PURPOSE : Returns TRUE if a DOS operation is being performed. Many
DOS services cannot be called if this is so.
PROCEDURE InitFOSSIL; (Concerto)
PURPOSE : Initializes the FOSSIL I/O driver for remote operation.
NOTES : Intended for INIT.SCR usage only.
FUNCTION Int_pChar(p:pChar; i:LongInt):pChar; (XStrings)
PURPOSE : Converts a LongInt to a string.
NOTES : The destination must have enough room to hold the worst-case
scenerio: a value of -2147483648 (the smallest LongInt possible.
Twelve bytes is sufficient to hold ten digits, the negative
sign and the terminating null-zero.
SEE ALSO : Int_Str
FUNCTION Int_Str(i:LongInt):STRING; (XStrings)
PURPOSE : Converts a LongInt to a Turbo Pascal string.
SEE ALSO : Int_pChar
FUNCTION IsAlNum(C:Char):Boolean; (XStrings)
PURPOSE : Returns TRUE if the character is a letter or number.
SEE ALSO : IsAlpha, IsDigit, IsLower, IsUpper, IsHiBit
FUNCTION IsAlpha(C:Char):Boolean; (XStrings)
PURPOSE : Returns TRUE if the character is a letter.
SEE ALSO : IsAlNum, IsDigit, IsLower, IsUpper, IsHiBit
FUNCTION IsDigit(C:Char):Boolean; (XStrings)
PURPOSE : Returns TRUE if the character is a number.
SEE ALSO : IsAlpha, IsAlNum, IsLower, IsUpper, IsHiBit
FUNCTION IsHiBit(C:Char):Boolean; (XStrings)
PURPOSE : Returns TRUE if the character is a high-bit ASCII character.
SEE ALSO : IsAlpha, IsAlNum, IsDigit, IsLower, IsUpper
FUNCTION IsLower(C:Char):Boolean; (XStrings)
PURPOSE : Returns TRUE if the character is a lower-case letter.
SEE ALSO : IsAlpha, IsAlNum, IsDigit, IsUpper, IsHiBit
FUNCTION IsUpper(C:Char):Boolean; (XStrings)
PURPOSE : Returns TRUE if the character is an upper-case letter.
SEE ALSO : IsAlpha, IsAlNum, IsDigit, IsLower, IsHiBit
FUNCTION KeyPressed:Boolean; (Keyboard)
PURPOSE : Returns TRUE if a character is waiting in the keyboard buffer.
SEE ALSO : ReadKey
FUNCTION LCM(N1,N2:LongInt):LongInt; (Math)
PURPOSE : Calculates the least common multiple of two integers.
SEE ALSO : GCF
FUNCTION Let(Variable,Equal:pChar):Boolean; (Scripts)
PURPOSE : Assigns a value to the specified variable.
RETURNS : TRUE if the operation was successful, FALSE if not. The
operation will fail if the specified variable is read-only
or does not exist.
PROCEDURE LineChat; (Concerto)
PURPOSE : Acticates the line-by-line scrolling chat-mode.
NOTES : The ChatCfg record contains the chat-mode configuration:
tChatCfg = RECORD
ExecPrompt : pChar;
Flags : Word;
Greeting : pChar;
Goodbye : pChar;
RemoteExit : Boolean;
SysopColors : tColorScheme;
UserColors : tColorScheme;
END;
The ExecPrompt string is displayed when the sysop presses
the forward slash (/) while the cursor is on the left-most
column of the screen. The sysop can then access any command
or variable. The remote callers cannot see the sysop's
typing, but will see the result(s) of the commands, if any.
The Flags field contains control-flags:
FEDCBA9876543210
││││││││││││││║╚═ Chat mode is currently active
││││││││││││││╚══ Force exit
└┴┴┴┴┴┴┴┴┴┴┴┴┴─── Reserved
Bit 0 is automatically set upon entry into chat-mode and
reset upon exit. Never modify this flag. Bit 1 is used
by the ExitChat procedure to force LineChat to exit.
You may set this flag at any time. The remaining bits
are reserved for future use.
The Greeting string is displayed whenever the sysops breaks
into chat-mode. The GoodBye string is displayed upon exit.
The default Greeting string is '~fgreeting|', which displays
the file GREETING.ANS. The associated script variables
are ChatGreeting and ChatGoodbye.
The RemoteExit boolean should be TRUE if the remote caller
is allowed to exit the chat-mode by pressing ESC (#27).
The following script variables allow the sysop to access the
individual fields in the two tColorScheme records:
ChatSysopDigit ChatUserDigit
ChatSysopHiBit ChatUserHiBit
ChatSysopLower ChatUserLower
ChatSysopPunct ChatUserPunct
ChatSysopUpper ChatUserUpper
The default color scheme uses cyan (3) for characters typed
by the sysop and light gray (7) for characters typed by the
caller. The IceChatColors script command changes the color
scheme to the palette used by IceChat, a popular chat door.
SEE ALSO : ExitChat
FUNCTION LoadDropFile(p:pChar):Boolean; (Concerto)
PURPOSE : Loads the specified drop file. If p is NIL, then the
procedure uses the path specified in the DropFile variable.
NOTES : Concerto currently supports DORINFOx.DEF, DOOR.SYS and
TRIBBS.SYS. A future version will implement a template
system that will allow any drop file to be used with Concerto.
DORINFOx.DEF:
01: BBS name
02: Sysop first name
03: Sysop last name
04: Communications port
05: BPS rate, parity, data bits, stop bits
06: Reserved (always zero)
07: User's first name
08: User's last name
09: User's location
10: 0=ASCII, 1=ANSI, 2=AVATAR
11: User's security level
12: User's time remaining in minutes
TRIBBS.SYS:
01: User's record number
02: User's full name
03: User's password
04: User's security level
05: Y=Expert, N=Novice
06: Y=ANSI, N=Monochrome
07: Minutes left for this call
08: User's phone number
09: User's city and state
10: User's birth date
11: Node number
12: Seriel port
13: Baud rate (0=local)
14: Locked rate (0=not locked)
15: Y=RTS/CTS, N=no RTS/CTS
16: Y=error correction
17: BBS Name
18: Sysop Name
PROCEDURE LoadRAConfig(VAR p:pRAConfig); (RA)
PURPOSE : Loads CONFIG.RA.
NOTES : Automatically allocates memory if the pointer is NIL. Be sure
to check for this.
SEE ALSO : LoadRASysInfo
PROCEDURE LoadRASysInfo(VAR SysInfo:SysInfoRecord); (RA)
PURPOSE : Loads SYSINFO.BBS from the system directory.
SEE ALSO : LoadRAConfig
FUNCTION LoCase(c:Char):Char; (XStrings)
PURPOSE : Returns the lower-case version of the character.
SEE ALSO : UpCase (SYSTEM.TPU)
FUNCTION MakeBaudCode(Baud:LongInt):Byte; (FOSSIL)
PURPOSE : Constructs a baud-rate code using 8N1 settings.
NOTES : Bits 7, 6 and 5 of the result specify the baud rate:
010 = 300
011 = 600
100 = 1200
101 = 2400
110 = 4800
111 = 9600
000 = 19200 (replaces old 110 baud mask)
001 = 38400 (replaces old 150 baud mask)
Bits 4 and 3 define the parity:
0 0 = No parity
1 0 = No parity
0 1 = Odd parity
1 1 = Even parity
Bit 2 defines the stop bits:
0 = 1 stop bit
1 = 1.5 bits for 5-bit characters, 2 for others
Bits 1 and 0 define the character length:
0 0 = 5 bits/character
0 1 = 6 bits/character
1 0 = 7 bits/character
1 1 = 8 bits/character
This procedure assumes 8N1 (eight bits per character, no
parity, one stop bit).
SEE ALSO : FOSSIL_Set_Baud
PROCEDURE MakeDir(Dir:pChar); (XDOS)
PURPOSE : Creates the specified directory.
SEE ALSO : RemoveDirectory
PROCEDURE MakeReadOnly(Variable:pChar); (Scripts)
PURPOSE : Makes a script variable read-only. A read-only variable cannot
be modified by the sysop.
NOTES : This procedure merely flags the variable as read-only. It
offers no protection against physical modification of the
EXE using a hex editor or DEBUG.
EXAMPLE : PROCEDURE Protect_Software;
BEGIN
MakeReadOnly('Author');
MakeReadOnly('Copyright');
MakeReadOnly('Version');
END;
FUNCTION MaxB(A,B:Byte):Byte; (Math)
PURPOSE : Returns the larger of the two bytes.
SEE ALSO : MaxS, MinS, MinB, MaxI, MinI, MaxW, MinW
FUNCTION MaxI(A,B:Integer):Integer; (Math)
PURPOSE : Returns the larger of the two integers.
SEE ALSO : MaxS, MinS, MaxB, MinB, MinI, MaxW, MinW
FUNCTION MaxS(A,B:ShortInt):ShortInt; (Math)
PURPOSE : Returns the larger of the two ShortInts.
SEE ALSO : MinS, MaxB, MinB, MaxI, MinI, MaxW, MinW
FUNCTION MaxW(A,B:Word):Word; (Math)
PURPOSE : Returns the larger of the two words.
SEE ALSO : MaxS, MinS, MaxB, MinB, MaxI, MinI, MinW
FUNCTION MinB(A,B:Byte):Byte; (Math)
PURPOSE : Returns the lesser of the two bytes.
SEE ALSO : MaxS, MinS, MaxB, MaxI, MinI, MaxW, MinW
FUNCTION MinI(A,B:Integer):Integer; (Math)
PURPOSE : Returns the lesser of the two integers.
SEE ALSO : MaxS, MinS, MaxB, MinB, MaxI, MaxW, MinW
FUNCTION MinS(A,B:ShortInt):ShortInt; (Math)
PURPOSE : Returns the lesser of the two ShortInts.
SEE ALSO : MaxS, MaxB, MinB, MaxI, MinI, MaxW, MinW
FUNCTION MinW(A,B:Word):Word; (Math)
PURPOSE : Returns the lesser of the two words.
SEE ALSO : MaxS, MinS, MaxB, MinB, MaxI, MinI, MaxW
FUNCTION Monochrome:Boolean; (Video)
PURPOSE : Returns TRUE if the local computer is using a monochrome
adapter.
FUNCTION nCr(N,R:LongInt):LongInt; (Math)
PURPOSE : Calculates the number of combinations.
SEE ALSO : Factorial, nPr
FUNCTION NLogX(N,X:Float):Float; (Math)
PURPOSE : Calculates the Nth base log of X.
FUNCTION nPr(N,R:LongInt):LongInt; (Math)
PURPOSE : Calculates the number of permutations.
SEE ALSO : Factorial, nCr
PROCEDURE NullProc; (Slicer)
PURPOSE : Does nothing.
SEE ALSO : ForceFalse, ForceTrue
PROCEDURE OpenClipboard; (Win95)
PURPOSE : Opens the Windows clipboard.
NOTES : You must call this procedure before using any other
clipboard procedures.
SEE ALSO : CloseClipboard, EmptyClipboard
FUNCTION OS2:Boolean; (Slicer)
PURPOSE : Returns TRUE if OS/2 (Operating System/2) is detected on
the local computer.
SEE ALSO : DesqView, DOSShell, DoubleDOS, TopView, Windows, Windows_Real
FUNCTION OS2_Version:Word; (Slicer)
PURPOSE : Returns the version of OS/2.
NOTES : The major version is returned in the low byte; the minor
version is returned in the high byte. The return value
of $0302 (2.3) is remapped to $0003 (3.0).
SEE ALSO : DesqView_Version, DOS_Version, DoubleDOS_Version,
TopView_Version, Windows_Version
PROCEDURE PackTime(VAR T:tDateTime; VAR P:LongInt); (XDOS)
PURPOSE : Converts a tDateTime to a 4-byte packed date/time LongInt.
NOTES : The LongInt is used by SetFTime
SEE ALSO : SetFTime
PROCEDURE Parse(p:pChar; VAR Index,Length,Next:Word); (Scripts)
PURPOSE : Parses a token in a string.
PARAMS : p The string to parse.
Index The starting position of the parser. Upon return
this variable contains the starting position of
the next token.
Length The length of the token.
Next The suggested starting position of the next Parse call.
FUNCTION pDelete(p:pChar; Index,Count:Word):pChar; (XStrings)
PURPOSE : Deletes a segment from a string.
SEE ALSO : Clip
FUNCTION Prime(N:LongInt):Boolean; (Math)
PURPOSE : Returns TRUE if the number is prime; FALSE if not.
PROCEDURE PrintScreen; (Video)
PURPOSE : Dumps the current text screen to the first printer.
NOTES : This is normally invoked by the INT09h handler when the
PrtSc (Print Screen) key is pressed.
PROCEDURE ProtectSourceVars; (Concerto)
PURPOSE : Makes the following script variables read-only:
Application
Author
Build
Company
Copyright
Version
NOTES : The script interpreter ignores any attempts to modify the
above variables, thus protecting the true source of the
door. Be aware, of course, that this procedure does not
protect against physical modification of the EXE using
a hex editor.
SEE ALSO : MakeReadOnly
FUNCTION Pythagoras(A,B:Float):Float; (Math)
PURPOSE : Returns the length of the hypotenuse of a right triangle
of the given adjacent lengths.
FUNCTION p_Boo(p:pChar):Boolean; (XStrings)
PURPOSE : Converts the string to a boolean (TRUE/FALSE) value.
NOTES : Blank strings default to true. The function will look
for T (True), F (False), Y (Yes), N (No), etc.
FUNCTION p_Char(p:pChar):Char; (XStrings)
PURPOSE : Converts a string to a character.
NOTES : Method Example Result
----------------------------
Normal str s
Decimal #99 c
Hex $4A J
FUNCTION p_Int(p:pChar):LongInt; (XStrings)
PURPOSE : Converts a string into a LongInt.
NOTES : You may specify the number in hexadecimal notation is you
start the string with a dollar sign ($). Example: $DEADBEEF
SEE ALSO : Str_Int
FUNCTION Rad_Deg (CONST R:Float) : Float; (Math)
PURPOSE : Converts radians to degrees.
SEE ALSO : Deg_Grd, Deg_Rad, Grd_Deg, Grd_Rad, Rad_Grd
FUNCTION Rad_Grd (CONST R:Float) : Float; (Math)
PURPOSE : Converts radians to gradians.
SEE ALSO : Deg_Grd, Deg_Rad, Grd_Deg, Grd_Rad, Rad_Deg
PROCEDURE ReadKey(VAR c:Char); (Keyboard)
PURPOSE : Reads a character from the keyboard.
NOTES : Stores the scan code in ScanCode.
SEE ALSO : KeyPressed
PROCEDURE RebootComputer(c:Char); (Reboot)
PURPOSE : Executes the selected reboot.
PARAMS : ┌─────┬──────────┐
│ c │ Method │
├─────┼──────────┤
│ c │ Cold │
│ h │ Hardware │
│ r │ Hardware │
│ w │ Warm │
└─────┴──────────┘
NOTES : a. The c parameter is not case sensitive.
b. The hardware reset method requires a 286 or later.
c. The cold and warm reboot methods may cause a general
protection fault (GPF) under some multitaskers.
EXAMPLE : BEGIN
WriteLn('WARNING: The computer will now reboot the PC.');
WriteLn('Please shut down all applications, then select');
WriteLn('the desired reboot method.');
WriteLn;
WriteLn(' C = Cold Reboot');
WriteLn(' H = Hardware Reset (286+)');
WriteLn(' W = Warm Reboot (skips memory test)');
WriteLn;
ReadLn(Method);
RebootComputer(Method);
WriteLn('REBOOT FAILURE! Please contact the author.');
END;
SEE ALSO : ColdReboot, HardwareReset, WarmReboot
PROCEDURE RegisterAmpersand; (IO)
PURPOSE : Registers the Ampersand state driver.
NOTES : The ampersand driver handles both PCBoard @Xxx codes and
WildCat! @xx@ codes, where xx is the hexadecimal representation
of a color.
SEE ALSO : RegisterANSI, RegisterAVATAR, RegisterControlK, RegisterHexPipe,
RegisterLORD
PROCEDURE RegisterANSI; (IO)
PURPOSE : Registers the ANSI state driver.
NOTES : The driver implements a subset of the full ANSI standard.
SEE ALSO : RegisterAmpersand, RegisterAVATAR, RegisterControlK,
RegisterHexPipe, RegisterLORD
PROCEDURE RegisterAVATAR; (IO)
PURPOSE : Registers the AVATAR/0+ state driver.
NOTES : The driver does not handle AVATAR scrolling functions.
SEE ALSO : RegisterAmpersand, RegisterANSI, RegisterControlK,
RegisterHexPipe, RegisterLORD
PROCEDURE RegisterBoolean(Name:pChar; Addr:Pointer); (Types)
PURPOSE : Registers a boolean variable with the script interpreter.
EXAMPLE : RegisterBoolean('DirectVideo',@CRT.DirectVideo);
PROCEDURE RegisterByte(Name:pChar; Addr:Pointer); (Types)
PURPOSE : Registers a byte with the script interpreter.
EXAMPLE : RegisterByte('TextAttr',@CRT.TextAttr);
PROCEDURE RegisterChar(Name:pChar; Addr:Pointer); (Types)
PURPOSE : Registers a character with the script interpeter.
EXAMPLE : RegisterChar('YourChar',@YourChar);
PROCEDURE RegisterConcerto; (Concerto)
PURPOSE : Registers the Concerto door enviroment. This includes the
run-time library, the color-code systems, the control-code
system and the descriptive-macro system.
NOTES : This procedure is mandatory.
PROCEDURE RegisterControlK; (IO)
PURPOSE : Registers the ^K state driver.
NOTES : Control-K codes are in the format ^K[xx, where ^K is ASCII
character #11 and xx is the hexadecimal representation of
a color. These codes are used by the RemoteAccess BBS package.
SEE ALSO : RegisterAmpersand, RegisterANSI, RegisterAVATAR,
RegisterHexPipe, RegisterLORD
PROCEDURE RegisterDirectory(Name:pChar; Addr:Pointer); (Types)
Registers a pChar holding a directory name. The object makes sure that
the string always contains a terminating slash character (/). The string
is automatically disposed upon termination of the door.
PROCEDURE RegisterDynamic(Name:pChar; Addr:Pointer); (Types)
PURPOSE : Registers a pChar with the script interpreter. The string
is automatically disposed with StrDispose upon termination
of the program.
SEE ALSO : RegisterDynamicNoDipose
PROCEDURE RegisterDynamicNoDispose(Name:pChar; Addr:Pointer); (Types)
PURPOSE : Registers a pChar with the script interpreter. The
string is not disposed by the interpreter upon termination
of the program. You must check for a non-NIL value and
call StrDispose yourself!
SEE ALSO : RegisterDynamic
PROCEDURE RegisterFCodeSystem; (Concerto)
PURPOSE : Registers the formatting-code/control-code system with Concerto.
SEE ALSO : RegisterMacroSystem
PROCEDURE RegisterFunction(Name:pChar; Addr:Pointer; Count:Byte); (Scripts)
PURPOSE : Registers a function with the script interpreter.
PARAMS : Name The name of the function (not case-sensitive).
Addr The address of the function handler.
Count The number of parameters to send to the handler.
NOTES : A function handler is declared as follows:
Where <NAME> is the name of the handler, and <POINTER>
is the name of a tParams pointer. The handler must use
any other parameters; this will cause memory stack problems.
PROCEDURE RegisterHexPipe; (IO)
PURPOSE : Registers the HexPipe state driver.
NOTES : HexPipe codes are in the format |xx, where xx is the
hexadecimal representation of a color.
SEE ALSO : RegisterAmpersand, RegisterANSI, RegisterAVATAR,
RegisterControlK, RegisterLORD
PROCEDURE RegisterLongInt(Name:pChar; Addr:Pointer); (Types)
PURPOSE : Registers a LongInt with the script interpreter.
EXAMPLE : RegisterLongInt('RandSeed',@System.RandSeed);
PROCEDURE RegisterLORD; (IO)
PURPOSE : Registers the LORD (Legend of the Red Dragon) color system.
SEE ALSO : RegisterAmpersand, RegisterANSI, RegisterAVATAR,
RegisterControlK, RegisterHexPipe, RegisterLORDFiles
PROCEDURE RegisterLORDFiles; (LORD)
PURPOSE : Registers the LORD (Legend of the Red Dragon) file paths.
NOTES : This procedure allows you or the sysop to access the various
LORD paths in any script or text file. This can be useful
in your installation program.
The LORD unit will automatically search for the LORD files
at run-time.
┌──────────────┬───────────────┬─────────────────────────────────────┐
│ Macro Name │ LORD.TPU Name │ Path to... │
├──────────────┼───────────────┼─────────────────────────────────────┤
│ 3RDPARTY.DAT │ LORD_3rdParty │ List of installed IGMs │
│ BADSAY.DAT │ LORD_BadSay │ Lamentings for death in user battle │
│ GOODSAY.DAT │ LORD_GoodSay │ Sayings when user battle is won │
│ LENEMY.DAT │ LORD_LEnemy │ Enemy list │
│ LOCKOUT.DAT │ LORD_LockOut │ List of locked-out users │
│ LORD.DAT │ LORD_Config │ LORD configuration │
│ LORDRIP.DAT │ LORD_RIP │ RIP (Remote Imaging Protocol) files │
│ LORDTXT.DAT │ LORD_Text │ Text files libraries │
│ NORMSAY.DAT │ LORD_NormSay │ Lamentings for forest death │
│ PLAYER.DAT │ LORD_Player │ Player database │
└──────────────┴───────────────┴─────────────────────────────────────┘
SEE ALSO : RegisterLORD
PROCEDURE RegisterMacroSystem; (Concerto)
PURPOSE : Registers the macro system with Concerto.
SEE ALSO : RegisterFCodeSystem
PROCEDURE RegisterMenu(Name,PathName:pChar); (DMenus)
PURPOSE : Registers a menu with the system.
PARAMS : Name A keyword to identify the menu in the future.
You must use a unique identifier.
PathName The name of the menu configuration script, or
INTERNAL (not case-sensitive). The script
is immediately processed if a valid path is
specified; otherwise, it is assumed that you
will create the menu internally.
PROCEDURE RegisterRASysInfo; (RA)
PURPOSE : Registers the SYSINFO.BBS information with Concerto.
NOTES : The fields of the SYSINFO.BBS record are saved as separate
variables in a VAR section (see above).
PROCEDURE RegisterString(Name:pChar; Addr:Pointer; Len:Byte); (Types)
PURPOSE : Registers a null-terminated string with the script
interpreter. The interpreter is free to assign strings
of any length to the variable, up to the specified
maximum length.
PROCEDURE RegisterTPString(Name:pChar; Addr:Pointer; Len:Byte); (Types)
PURPOSE : Registers a Turbo Pascal string with the script interpreter.
You must specify the maximum length of the string (not the
current length or memory size of the string!).
EXAMPLE : RegisterTPString('YourString',@YourString,255);
PROCEDURE RegisterWord(Name:pChar; Addr:Pointer); (Types)
PURPOSE : Registers a Word with the script interpreter.
EXAMPLE : RegisterWord('LastMode',@CRT.LastMode);
PROCEDURE Release; (Slicer)
PURPOSE : Releases the current timeslice back to the operating system.
NOTES : This procedure merely calls Tasker[MT].Release, where MT
is a byte indentifying the operating system:
_DOS = 0;
_DesqView = 1;
_DoubleDOS = 2;
_OS2 = 3;
_TopView = 4;
_Windows = 5;
It is more efficient to caller Tasker[MT].Release, although
not much more efficient. You may also force Concerto to
use a different method:
Example: Tasker[_Windows].Release
Example: Tasker[_TopView].Release
SEE ALSO : DOS_Release, DoubleDOS_Release, TopView_Release, Windows_Release
PROCEDURE RemoveDirectory(Dir:pChar); (XDOS)
PURPOSE : Removes the specified directory.
SEE ALSO : MakeDir
PROCEDURE RenameFile(OldPath,NewPath:pChar); (XDOS)
PURPOSE : Renames the specified file.
NOTES : Both filespecs must use the same disk drive, although
they do not have to specify the same directory.
PROCEDURE Replace(CONST ThisStr,WithStr:OpenString; VAR InStr:OpenString); (XStrings)
PURPOSE : Replaces a substring with a different string.
NOTES : Replace ThisStr with WithStr in InStr.
PROCEDURE Ring; (Sounds)
PURPOSE : Simulates a telephone ring on the local computer.
SEE ALSO : Siren
FUNCTION RunMenu(Name:pChar):Byte; (DMenus)
PURPOSE : Executes a previously loaded menu.
FUNCTION SafeCopy(VAR Dest:pChar; Source:pChar):pChar; (XStrings)
PURPOSE : Copies the contents of Source into Dest. If Dest in not NIL,
then the procedure reallocates memory using StrDispose and
StrNew.
EXAMPLE : SafeCopy(MyString,ThisValue);
:
compare to:
:
IF MyString<>NIL THEN
StrDispose(MyString);
MyString:=StrNew(MyString);
FUNCTION ScanChars(p:pChar; At:Word; List:CharSet):Word; (XStrings)
PURPOSE : Returns the index of the first character in the set.
NOTES : The index of the null-zero is returned if the search
is not successful.
EXAMPLE : ScanChars('Hello', 0, ['e','o']) = 1
ScanChars('Hello', 2, ['e','o']) = 4
SEE ALSO : ScanNChars
FUNCTION ScanNChars(p:pChar; At:Word; List:CharSet):Word; (XStrings)
PURPOSE : Returns the index of first character NOT in the set.
NOTES : The index of the null-zero is returned if the search
is not successful.
EXAMPLE : ScanNChars('Hello', 0, ['H','o']) = 1
ScanNChars('Hello', 4, ['H','o']) = 5
FUNCTION Script(p:pChar):Word; (Scripts)
PURPOSE : Executes a script file.
NOTES : The ScriptDir string is used instead of any specified path,
if ScriptDir is not NIL.
SEE ALSO : Execute
FUNCTION SearchFor(p:pChar):pID; (Scripts)
PURPOSE : Scans the list of identifiers stored in IDs and returns a
pointer if the specified name exists.
FUNCTION SEC(CONST R:Float):Float; (Math)
PURPOSE : Calculates the secand of the argument.
SEE ALSO : COT, CSC, TAN
FUNCTION SECH(CONST R:Float):Float; (Math)
PURPOSE : Calculates the hyperbolic secant of the argument.
SEE ALSO : COSH, COTH, SINH, TANH
PROCEDURE SetCBreak(Break:Boolean); (XDOS)
PURPOSE : Sets the control-breaking status of DOS.
SEE ALSO : GetCBreak
PROCEDURE SetClipboardData(p:pChar); (Win95)
PURPOSE : Copies the specified text to the Windows clipboard.
NOTES : The clipboard must be open (see OpenClipboard).
EXAMPLE : PROCEDURE WriteString(p:pChar);
BEGIN
OpenClipboard;
SetClipboardData(p);
CloseClipboard;
END;
SEE ALSO : CloseClipboard, OpenClipboard
FUNCTION SetColorScheme(p:pColorScheme):pColorScheme; (IO)
PURPOSE : Changes to the specified color scheme.
NOTES : The function returns a pointer to the previous color scheme.
You should save this value for later restoration.
EXAMPLE : FUNCTION SO_Weird(p:pChar);
VAR
Weird : tColorScheme;
Previous : pColorScheme;
BEGIN
WITH Weird DO
BEGIN
Lower := Random(256);
Upper := Random(256);
Digit := Random(256);
HiBit := Random(256);
Punct := Random(256);
END;
Previous:=SetColorScheme(@Weird);
SO_pChar(p);
SetColorScheme(Previous);
END;
PROCEDURE SetCursorShape(Define:Word); (Video)
PURPOSE : Defines the shape of the cursor.
NOTES : The high byte defines the top scan line and any options:
00000000
│││└┴┴┴┴─ Top scan line
│└┴────── 00 = Normal
│ 01 = Invisible
│ 10 = Erratic
│ 11 = Slow
└──────── Should be zero
The low byte contains the bottom scan line. This service
may be buggy on some EGA systems.
SEE ALSO : CursorOff, CursorOn
PROCEDURE SetDate(Year, Month, Day: Word); (XDOS)
PURPOSE : Sets the date of the operating system.
NOTES : The year must be between 1980 and 2099. Invalid dates
are ignored.
SEE ALSO : GetDate
PROCEDURE SetFocus(VM:Word); (Win95)
PURPOSE : Sets the focus to the specified virtual machine.
NOTES : Use VM=0000h to specify the current virtual machine.
Windowed DOS boxes are set to full screen.
PROCEDURE SetIntVec(IntNo:Byte; Vector:Pointer); (XDOS)
PURPOSE : Sets the vector for the specified interrupt number.
SEE ALSO : GetIntVec
FUNCTION SetNoTimeProcedure(p:Pointer):Pointer; (IO)
PURPOSE : Changes the no-time-left procedure.
RETURNS : A pointer to the current procedure, or NIL.
PROCEDURE SetOverscan(Color:Byte); (Video)
PURPOSE : Sets the color of the overscan box.
NOTES : The overscan box is the (usually) dark area surrounding the
video screen. Although programs may not write text or
graphics to this area, it is possible to change its color.
SEE ALSO : SetOverscan
FUNCTION SetSwitchChar(Switch:Char):Boolean; (XDOS)
PURPOSE : Changes the default command-line switch character.
NOTES : Returns TRUE if the function worked, FALSE if not.
SEE ALSO : GetSwitchChar
PROCEDURE SetTime(Hour, Minute, Second, Sec100: Word); (XDOS)
PURPOSE : Sets the time of the operating system.
NOTES : Valid ranges are 0 to 23 hours, 0 to 59 minutes,
0 to 59 seconds, and 0 to 99 hundredths of seconds.
FUNCTION SetTimeOutProcedure(p:Pointer):Pointer; (IO)
PURPOSE : Changes the time-out procedure.
RETURNS : A pointer to the current time-out procedure, or NIL.
PROCEDURE SetVerify(Verify:Boolean); (XDOS)
PURPOSE : Sets the DOS verify status.
NOTES : If on, disk writes are verified to ensure proper writing.
SEE ALSO : GetVerify
PROCEDURE SetVideoMode(Mode:Byte); (Video)
PURPOSE : Places the video adapter into the specified mode.
SEE ALSO : GetVideoMode
FUNCTION SetVideoPage(Page:Byte):Boolean; (Video)
PURPOSE : Changes to the specified video page.
NOTES : The function returns TRUE if the page switch worked; FALSE
if not.
FUNCTION SHARE_Install_Status:Byte; (XDOS)
PURPOSE : Returns 0 if SHARE is not installed, 1 if it cannot be
installed, and FF if it is installed.
SEE ALSO : SHARE_Loaded
FUNCTION SHARE_Loaded:Boolean; (XDOS)
PURPOSE : Returns TRUE if SHARE.EXE is loaded.
SEE ALSO : SHARE_Install_Status
FUNCTION ShiftRight(p:pChar; n:Word; c:Char):pChar; (XStrings)
PURPOSE : Shifts the characters in the string toward the right.
NOTES : The start of the string is filled with the specified
character. This is normally #32 (spaces).
EXAMPLES : ShiftRight('Hello', 3, ' ') = ' Hello'
PROCEDURE ShowStatusLine(p:pChar); (Concerto)
PURPOSE : Shows the specified status line, where p is the name of
the identifier saved in the IDs collection.
EXAMPLE : BEGIN
CASE Random(3) OF
0 : ShowStatusLine('Help');
1 : ShowStatusLine('Quote');
2 : ShowStatusLine('Peter');
END;
END;
SEE ALSO : HideStatusLine
FUNCTION Simpson(CONST y:tFUNCTION; CONST a,b,n:LongInt):Float; (Math)
PURPOSE : Calculates the area under the curve of the given function,
using Simpson's approximation procedure.
PARAMS : y = A Turbo Pascal function: FUNCTION(x:Float):Float
a = Lower limit
b = Upper limit
n = Number of iterations
FUNCTION SINH(CONST R:Float):Float; (Math)
PURPOSE : Calculates the hyperbolic sine of the argument.
SEE ALSO : COSH, COTH, SECH, TANH
PROCEDURE Siren(Resolution,Amplitude,Midline,DelayFactor,Count:Word); (Sounds)
PURPOSE : Generates a cosine siren on the local computer.
NOTES : A cosine curve looks something like this:
1 ∙ . . ∙
│ ∙ ∙
│ ∙ ∙
│ ∙ ∙
0 ──┼───────────────────────────────────────
│ ∙ ∙
│ ∙ ∙
│ ∙ ∙
-1 │ ∙ . ∙
0 π/2 π 3π/2 2π
Notice that the cosine graph repeats one full cycle every
2π (6.28) units. This is the basis for many different sirens.
The sound at any given point is calculated from this curve.
PARAMS : Resolution The cosine curve is divided into a large number
of steps. The siren cycles through each step and
creates a sound based on the curve at that step.
The number of steps is the resolution of the siren.
Amplitude Each step is multiplied by the amplitude. Since
the peaks of the curve have a maximum value of +1
and a minimum value of -1, this generates an
effective range of -Amplitude to +Amplitude.
Midline The middle frequency (i.e. the line through the
middle of the curve). The final range of the
siren is Midline-Amplitude to Midline+Amplitude.
Delay This parameter allows you to tweak the speed of
the siren, which is dependent of the clock speed
of the CPU. Adjust this factor if the siren
sounds bad.
Count The number of times to repeat the siren.
SEE ALSO : Ring
FUNCTION SI_Boolean(Prompt:pChar; Default:Boolean):Boolean; (IO)
PURPOSE : This is a high-level boolean-entry routine.
NOTES : The prompt and a color-coded selection-bar is displayed. The
user may press Y (true) or N (false). The screen is updated
with the response (Yes or No).
EXAMPLE : IF SI_Boolean('Clear the screen? ',True) THEN
SO_ClrScrWith(7);
SEE ALSO : SI_Char
FUNCTION SI_Char(VAR c:Char):Char; (IO)
PURPOSE : Reads a single character.
NOTES : The character is retrieved from the first IO driver that has
a character waiting in its buffer. Use the Origin pointer if
you need to know the exact driver.
This is the master keyboard polling routine. All input
routines ultimately call this procedure.
SEE ALSO : SI_KeyPressed
PROCEDURE SI_DefaultMorePrompt; (IO)
PURPOSE : Waits for the enter key (ASCII #13).
NOTES : Nothing is displayed.
SEE ALSO : SO_ReadChar
FUNCTION SI_KeyList(Allowed:pChar; Default:Char):Char; (IO)
PURPOSE : Waits for the user to select one of the characters in the
string. The default character is returned if the user
presses Enter, unless the default character is #0 (at which
an Enter keystroke is ignored).
NOTES : The character is returned in upper-case.
SEE ALSO : SI_KeyListX
FUNCTION SI_KeyListX(Allowed:pChar; Default:Char):Char; (IO)
PURPOSE : Waits for the user to select one of the characters in the
string. This function is identical to SI_KeyList, except
that it displays a fancy prompt before waiting from an
entry from the caller.
NOTES : The character is returned in upper-case.
SEE ALSO : SI_KeyList
FUNCTION SI_KeyPressed:Boolean; (IO)
PURPOSE : Returns TRUE if a character is waiting.
NOTES : This is a non-destructive read -- you will still need to
use SO_ReadChar to remove the character from the buffer.
SEE ALSO : SO_ReadChar
PROCEDURE SI_LORDMorePrompt; (IO)
PURPOSE : Simulates the LORD (Legend of the Red Dragon) <MORE> prompt.
SEE ALSO : SI_DefaultMorePrompt;
FUNCTION SI_pChar(p:pChar; MaxLen:Byte):pChar; (IO)
PURPOSE : Provides a simple string input routine.
NOTES : MaxLen specifies the maximum length of the string. It is up
to you to make sure that the input field does not wrap across
the screen. If p is not empty, the user will be able to
edit the characters. Minimal range checking is performed.
SEE ALSO : SI_Char
PROCEDURE SI_Purge; (IO)
PURPOSE : Removes any characters from the inbound buffer.
SEE ALSO : SO_Purge
FUNCTION SI_Randomize(p:pChar):Word; (IO)
PURPOSE : Initializes the random number generator.
NOTES : If p is 'Timer', then the random number seed is obtained
from the system clock. If p is 'Ask', then the user is
prompted for the number. Anything other string is
converted to a numeric value.
PROCEDURE SO_Char(c:Char); (IO)
PURPOSE : Displays a single character.
SEE ALSO : SO_pChar, SO_SendString
PROCEDURE SO_ClearRegion(x,y1,y2:Byte); (IO)
PURPOSE : Clears the region within the box.
PARAMS : x Left-column of box
y1 Top row
y2 Bottom row
NOTES : This procedure uses the SO_ClrEOL procedure to quickly
clear the region. The cursor is moved to the upper-left
corner of the box when finished.
SEE ALSO : SO_ClrScr, SO_ClrScrWith
PROCEDURE SO_ClrEOL; (IO)
PURPOSE : Erases all of the characters between the cursor and the left
side of the screen, inclusively.
SEE ALSO : SO_ClrEOLWith, SO_ClrScr, SO_ClrScrWith
PROCEDURE SO_ClrEOLWith(c:Byte); (IO)
PURPOSE : Changes the color and calls SO_ClrEOL at the same time.
SEE ALSO : SO_ClrEOL, SO_ClrScr, SO_ClrScrWith, SO_Color
PROCEDURE SO_ClrScr; (IO)
PURPOSE : Clears the screen using the current color.
NOTES : The status line (if visible) is not affected. The cursor is
moved to the upper-left corner of the screen.
SEE ALSO : SO_ClearRegion, SO_ClrEOL, SO_ClrScrWith, SO_Color, SO_GotoXY,
SO_Home
PROCEDURE SO_ClrScrWith(c:Byte); (IO)
PURPOSE : Clears the screen using the specified color.
NOTES : The color change is permanent.
SEE ALSO : SO_ClearRegion, SO_ClrEOL, SO_ClrScr, SO_Color, SO_GotoXY,
SO_Home
FUNCTION SO_Color(c:Byte):Byte; (IO)
PURPOSE : Changes the current color.
RETURNS : The current color (before the change).
NOTES : You should never modify TextAttr directly, since the IO drivers
will not be aware of the change. Use this procedure instead,
which sends the color change to each driver.
SEE ALSO : SO_ClrEOLWith, SO_ClrScrWith
PROCEDURE SO_CRLF; (IO)
PURPOSE : Outputs a carriage-return/line-feed sequence.
NOTES : This is essentially the same as SO_pChar(#13#10).
SEE ALSO : SO_pChar, SO_pCharLn
PROCEDURE SO_CursorDown(n:Byte); (IO)
PURPOSE : Moves the cursor down.
SEE ALSO : SO_CursorLeft, SO_CursorRight, SO_CursorUp, SO_GotoXY, SO_Home
PROCEDURE SO_CursorLeft(n:Byte); (IO)
PURPOSE : Moves the cursor left.
SEE ALSO : SO_CursorDown, SO_CursorRight, SO_CursorUp, SO_GotoXY, SO_Home
PROCEDURE SO_CursorRight(n:Byte); (IO)
PURPOSE : Moves the cursor right.
SEE ALSO : SO_CursorDown, SO_CursorLeft, SO_CursorUp, SO_GotoXY, SO_Home
PROCEDURE SO_CursorUp(n:Byte); (IO)
PURPOSE : Moves the cursor up.
SEE ALSO : SO_CursorDown, SO_CursorLeft, SO_CursorRight, SO_GotoXY, SO_Home
FUNCTION SO_DateFile(Month,Day:Byte):Boolean; (IO)
PURPOSE : Displays the file MM-DD.ANS, where MM is the specified month
and DD is the specified day. If you call this procedure with
Month=0 and Day=0, then the current date is used instead.
SEE ALSO : SO_DisplayFile
FUNCTION SO_DetectANSI(p:pIODriverRemote; Msg:pChar):Boolean; (IO)
PURPOSE : Checks for ANSI capabilities on the remote system.
NOTES : The procedure first sends the special sequence ESC[6n, which
is normally used to request the current position of the cursor.
We are not actually interested in the cursor position, but
rather the response (or lack thereof) of the terminal.
ANSI-capable terminals will return the cursor position in
the format ESC[#;#R. A valid response implies ANSI support.
If ANSI is not detected, the procedure will ask the user
for his/her preference.
FUNCTION SO_DisplayFile(p:pChar):Boolean; (IO)
PURPOSE : Displays the specified file.
NOTES : Concerto loads the specified file and sends it to SO_pChar for
processing. TRUE is returned if the operation was successful.
FALSE is returned if the procedure could not load the file.
If TextDir is NIL, Concerto will check the current directory.
Otherwise the specified directory will be used.
The TextBufferSize variable (IO.PAS) defines the size of the
buffer to use when loading the file. The default value is 1024
bytes.
SEE ALSO : SO_DateFile, SO_pChar, TextDir
PROCEDURE SO_GotoXY(x,y:Byte); (IO)
PURPOSE : Changes the position of the the cursor.
NOTES : This procedure changes the position of the cursor in ANSI or
AVATAR mode. The upper-left corner of the screen has the
coordinates (1,1). Invalid coordinates are ignore.
SEE ALSO : SO_CursorDown, SO_CursorLeft, SO_CursorRight,
SO_CursorUp, SO_Home
EXAMPLE : FOR n:=1 TO Random(200) DO
BEGIN
SO_GotoXY(Random(80)+1,Random(23)+1);
SO_Color(Random(16));
SO_SendChar(#219);
END;
SEE ALSO : SO_CursorDown, SO_CursorLeft, SO_CursorRight,
SO_CursorUp, SO_Home
PROCEDURE SO_Home; (IO)
PURPOSE : Moves the cursor to the home position.
NOTES : This procedure moves the cursor to the upper-left corner
of the screen. This is essentially the same as calling
SO_GotoXY(1,1).
SEE ALSO : SO_CursorDown, SO_CursorLeft, SO_CursorRight,
SO_CursorUp, SO_GotoXY
PROCEDURE SO_Noise; (IO)
PURPOSE : Generates fake line noise.
PROCEDURE SO_pChar(p:pChar); (IO)
PURPOSE : Displays the null-terminated string. Color-codes are processed.
NOTES : This is the Master display routine. All other output procedures
ultimately call this procedure, except for the raw-output set
of procedures.
SEE ALSO : SO_pCharLn
PROCEDURE SO_pCharLn(p:pChar); (IO)
PURPOSE : Displays the null-terminated string.
NOTES : A carriage-return/line-feed sequence is also sent.
SEE ALSO : SO_CRLF, SO_pChar
PROCEDURE SO_Purge; (IO)
PURPOSE : Removes any characters from the outbound buffer.
SEE ALSO : SI_Purge;
PROCEDURE SO_RawCentered(p:pChar; ClearLine:Boolean); (IO)
PURPOSE : Centers the string on the current line. The text on the
line will be cleared in ClearLine is TRUE.
SEE ALSO : SO_pChar, SO_String
PROCEDURE SO_RawChar(c:Char); (IO)
PURPOSE : Displays a character with no processing.
SEE ALSO : SO_RawpChar, SO_RawString
PROCEDURE SO_RawpChar(s:pChar); (IO)
PURPOSE : Displays a pChar with no processing.
SEE ALSO : SO_RawChar, SO_String
PROCEDURE SO_RawString(CONST s:OpenString); (IO)
PURPOSE : Displays a TP string with no processing.
SEE ALSO : SO_RawChar, SO_RawpChar
PROCEDURE SO_RepeatChar(c:Char; n:Byte); (IO)
PURPOSE : Repeatedly displays a character.
NOTES : The characters are not processed by the state-driver system.
EXAMPLE : BEGIN
SO_pCharLn('Look at this 32x3 box!');
SO_Char('┌'); SO_RepeatChar('─', 30); SO_Char('┐);
SO_Char('│'); SO_RepeatChar(' ', 30); SO_Char('│');
SO_Char('└'); SO_RepeatChar('─', 30); SO_Char('┘');
END;
SEE ALSO : SO_Char, SO_pChar
PROCEDURE SO_ShadeBar(Selection:Byte); (IO)
PURPOSE : Displays a shaded bar for general use.
NOTES : This procedure is used by SO_DetectANSI when inquiring the
caller about his/her ANSI capabilities. The bar is six
characters long. Future versions will support scaling.
Selection = 0 : Random color palette
1 : Darkgray -> White
2 : Green -> Yellow
3 : Red -> Yellow
4 : Cyan -> White
5 : Blue -> Light Cyan
6 : Magenta -> White
SEE ALSO : SO_DetectANSI
PROCEDURE SO_String(CONST s:OpenString); (IO)
PURPOSE : Displays a classic Turbo Pascal string.
NOTES : The string is converted to a pChar and sent to SO_pChar.
SEE ALSO : SO_pChar
FUNCTION StringOf(n:Byte; c:Char):STRING; (XStrings)
PURPOSE : Returns a TP string filled with the specified character.
NOTES : This function is much like the QBASIC STRING$ function.
FUNCTION StrInsert(Dest,Source:pChar; Index:Word):pChar; (XStrings)
PURPOSE : Inserts a string into another string.
NOTES : No range checking is performed.
FUNCTION StrScanI(Str:pChar; Chr:Char):pChar; (XStrings)
PURPOSE : Returns the first occurance of the specified character in
the string, or NIL. This function is identical to StrScan
in the STRINGS.TPU unit, except that it is not case-sensitive.
FUNCTION StrSegment(Dest,Source:pChar; Index,Length:Word):pChar; (XStrings)
PURPOSE : Extracts a segment from a string.
PARAMS : Dest Destination string.
Source Source string.
Index Start of the segment.
Length Length of the segment.
NOTES : The destination must contain enough room for LENGTH characters
plus the terminating null-zero.
FUNCTION Str_Int(CONST s:OpenString):LongInt; (XStrings)
PURPOSE : Converts a Turbo Pascal string to a LongInt.
SEE ALSO : p_Int
FUNCTION Surface_Area_Box(CONST L,W,H:Float):Float; (Math)
PURPOSE : Calculates the surface area of a box with the given length,
width and height.
┌───┐
/ │ / │ H
╔═══╗───┘ Surface Area = 2LH + 4WH
║ ║ / W
╚═══╝
L
SEE ALSO : Surface_Area_Cone, Surface_Area_Cylinder, Surface_Area_Cube,
Surface_Area_Sphere
FUNCTION Surface_Area_Cone(CONST Radius,Height:Float):Float; (Math)
PURPOSE : Calculates the surface area of a cone with the given radius
and height.
SEE ALSO : Surface_Area_Box, Surface_Area_Cylinder, Surface_Area_Cube,
Surface_Area_Sphere
FUNCTION Surface_Area_Cube(CONST Side:Float):Float; (Math)
PURPOSE : Calculates the surface area of a cube with the given length.
SEE ALSO : Surface_Area_Box, Surface_Area_Cone, Surface_Area_Cylinder,
Surface_Area_Sphere
FUNCTION Surface_Area_Cylinder(CONST Radius,Height:Float):Float; (Math)
PURPOSE : Calculates the surface area of a cylinder with the given
radius and height.
SEE ALSO : Surface_Area_Box, Surface_Area_Cone, Surface_Area_Cube,
Surface_Area_Sphere
FUNCTION Surface_Area_Sphere(CONST Radius:Float):Float; (Math)
PURPOSE : Calculates the surface area of a sphere with the given radius.
SEE ALSO : Surface_Area_Box, Surface_Area_Cone, Surface_Area_Cylinder,
Surface_Area_Cube
FUNCTION TAN(CONST R:Float):Float; (Math)
PURPOSE : Calculates the tangent of the argument.
SEE ALSO : COT, CSC, SEC
FUNCTION TANH(CONST R:Float):Float; (Math)
PURPOSE : Calculates the hyperbolic tangent of the argument.
SEE ALSO : COSH, COTH, SECH, SINH
PROCEDURE TextColors(Attr:Byte; VAR Fore,Back:Byte); (Video)
PURPOSE : Extracts the foreground and background colors from a
text attribute.
NOTES : 7 6 5 4 3 2 1 0
│ │ │ │ │ │ │ │
│ │ │ │ └─┴─┴─┴─ Foreground color
│ └─┴─┴───────── Background color
└─────────────── Blinking bit
Rather than calling this procedure, you may do the following:
Foreground := Attr AND $0F;
Background := ( Attr AND $F0 ) SHR 4;
EXAMPLE : PROCEDURE DisplayColors;
VAR
FG : Byte;
BG : Byte;
BEGIN
TextColors(TextAttr,FG,BG);
WriteLn('The current foreground color is ',FG,'.');
WriteLn('The current background color is ',BG,'.');
END;
FUNCTION TextGfx_ClrEOL(Flags:Byte):STRING; (Video)
PURPOSE : Returns the ASCII, ANSI or AVATAR equivilant of a ClrEOL
(clear to end of line) command, based on the Flags byte.
NOTES : The Flags byte is a mask:
7 6 5 4 3 2 1 0
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ └─ ANSI sequences can be used
│ │ │ │ │ │ └─── AVATAR sequences can be used
└─┴─┴─┴─┴─┴───── Reserved for future use
The function will return the most efficient string possible.
SEE ALSO : TextGfx_ClrScr, TextGfx_Color, TextGfx_CursorLeft,
TextGfx_CursorRight, TextGfx_GotoXY
FUNCTION TextGfx_ClrScr(Flags:Byte):STRING; (Video)
PURPOSE : Returns the ASCII, ANSI or AVATAR equivilant of a ClrScr
(clear screen) command, based on the Flags byte.
NOTES : Refer to TextGfx_ClrEOL for a description of the Flags byte.
The function will return the most efficient string possible.
SEE ALSO : TextGfx_ClrEOL, TextGfx_Color, TextGfx_CursorLeft,
TextGfx_CursorRight, TextGfx_GotoXY
FUNCTION TextGfx_Color(Flags,Old,New:Byte):STRING; (Video)
PURPOSE : Returns the ASCII, ANSI or AVATAR equivilant of a Color
(set text color) command, based on the Flags byte.
NOTES : Refer to TextGfx_ClrEOL for a description of the Flags byte.
The function will return the most efficient string possible.
SEE ALSO : TextGfx_ClrEOL, TextGfx_ClrScr, TextGfx_CursorLeft,
TextGfx_CursorRight, TextGfx_GotoXY
FUNCTION TextGfx_CursorLeft(Flags,n:Byte):STRING; (Video)
PURPOSE : Returns the ASCII, ANSI or AVATAR equivilant of a CursorLeft
(move cursor left) command, based on the Flags byte.
NOTES : Refer to TextGfx_ClrEOL for a description of the Flags byte.
The function will return the most efficient string possible.
SEE ALSO : TextGfx_ClrEOL, TextGfx_ClrScr, TextGfx_Color,
TextGfx_CursorRight, TextGfx_GotoXY
FUNCTION TextGfx_CursorRight(Flags,n:Byte):STRING; (Video)
PURPOSE : Returns the ASCII, ANSI or AVATAR equivilant of a CursorRight
(move cursor right) command, based on the Flags byte.
NOTES : Refer to TextGfx_ClrEOL for a description of the Flags byte.
The function will return the most efficient string possible.
SEE ALSO : TextGfx_ClrEOL, TextGfx_ClrScr, TextGfx_Color,
TextGfx_CursorLeft, TextGfx_GotoXY
FUNCTION TextGfx_GotoXY(Flags,X,Y:Byte):STRING; (Video)
PURPOSE : Returns the ASCII, ANSI or AVATAR equivilant of a GotoXY
(position cursor) command, based on the Flags byte.
NOTES : Refer to TextGfx_ClrEOL for a description of the Flags byte.
The function will return the most efficient string possible.
SEE ALSO : TextGfx_ClrEOL, TextGfx_ClrScr, TextGfx_Color,
TextGfx_CursorLeft, TextGfx_CursorRight
FUNCTION TopView:Boolean; (Slicer)
PURPOSE : Returns TRUE if TopView or compatible is loaded.
SEE ALSO : DesqView, DOSShell, DoubleDOS, OS2, Windows, Windows_Real
PROCEDURE TopView_CriticalBegin; (Slicer)
PURPOSE : Disables task-switching in TopView or DesqView.
SEE ALSO : TopView_CriticalEnd
PROCEDURE TopView_CriticalEnd; (Slicer)
PURPOSE : Enables task-switching in TopView or DesqView.
SEE ALSO : TopView_CriticalBegin
PROCEDURE TopView_Release; (Slicer)
PURPOSE : Releases the current timeslice back to TopView or DesqView.
SEE ALSO : Release, DOS_Release, DoubleDOS_Release, Windows_Release
FUNCTION TopView_Version:Word; (Slicer)
PURPOSE : Returns the version of TopView.
NOTES : The major version is returned in the low byte; the minor
version is returned in the high byte.
SEE ALSO : DesqView_Version, DOS_Version, DoubleDOS_Version, OS2_Version,
Windows_Version
FUNCTION TPErrorMessage(n:Byte):STRING; (XDOS)
PURPOSE : Returns the Turbo Pascal error message for the specified
exit code.
FUNCTION TrimLeft(p:pChar; c:Char):pChar; (XStrings)
PURPOSE : Trims the given character from the left side of a string.
SEE ALSO : TrimRight
FUNCTION TrimRight(p:pChar; c:Char):pChar; (XStrings)
PURPOSE : Trims the given character from the right side of a string.
SEE ALSO : TrimLeft
FUNCTION TrimSpaces(p:pChar):pChar; (XStrings)
PURPOSE : Removes any spaces from the left and right sides of the string.
SEE ALSO : Clip, Delete, TrimLeft, TrimRight
PROCEDURE UnpackTime(P:LongInt; VAR T:tDateTime); (XDOS)
PURPOSE : Converts a file timestamp into a tDateTime record.
FUNCTION VGA_Detected:Boolean; (Video)
PURPOSE : Returns TRUE if a VGA-compatible adapter was detected.
SEE ALSO : EGA_BIOS
FUNCTION VGA_GetPixel(X,Y:Word):Byte; (Video)
PURPOSE : Returns the color of the pixel at location (X,Y).
NOTES : This function assumes that the adapter is in Mode 13h
(320x200x256 VGA).
SEE ALSO : GetVideoMode, SetVideoMode, VGA_SetPixel
PROCEDURE VGA_SetPixel(X,Y:Word; Color:Byte); (Video)
PURPOSE : Changes the pixel at location (X,Y) to the specified color.
NOTES : This procedure assumes that the current video mode is 13h
(320x200x256 VGA).
SEE ALSO : GetVideoMode, SetVideoMode, VGA_GetPixel
FUNCTION Volume_Box(CONST X,Y,Z:Float):Float; (Math)
PURPOSE : Calculates the volume of a box with the given lengths.
SEE ALSO : Volume_Cone, Volume_Cube, Volume_Cylinder, Volume_Sphere
FUNCTION Volume_Cone(CONST Radius,Height:Float):Float; (Math)
PURPOSE : Calculates the volume of a cone with the given radius and
height.
SEE ALSO : Volume_Box, Volume_Cube, Volume_Cylinder, Volume_Sphere
FUNCTION Volume_Cube(CONST Side:Float):Float; (Math)
PURPOSE : Calculates the volume of a cube with the given side length.
SEE ALSO : Volume_Box, Volume_Cone, Volume_Cylinder, Volume_Sphere
FUNCTION Volume_Cylinder(CONST Radius,Height:Float):Float; (Math)
PURPOSE : Calculates the volume of a cylinder with the given radius
and height.
SEE ALSO : Volume_Box, Volume_Cone, Volume_Cube, Volume_Sphere
FUNCTION Volume_Sphere(CONST Radius:Float):Float; (Math)
PURPOSE : Calculates the volume of a sphere with the given radius.
SEE ALSO : Volume_Box, Volume_Cone, Volume_Cube, Volume_Cylinder
PROCEDURE WaitRetrace; (Video)
PURPOSE : Delays the program until it is possible to write to the
screen without causing flicker.
PROCEDURE WarmReboot; (Reboot)
PURPOSE : Invokes a warm reboot on the computer system.
NOTES : A warm reboot will the skip the initial memory test on
most computer systems. This procedure may cause problems
in some multitasked and networked enviroments.
EXAMPLE : PROCEDURE SystemHasCrashed;
VAR
Loop : Byte;
BEGIN
WriteLn('The program is unable to recover from a fatal');
WriteLn('error. Rather than return to the BBS and risk');
WriteLn('further damage to your system, the computer will');
WriteLn('now reboot. This will allow your AUTOEXEC.BAT');
WriteLn('file to restart the BBS.');
WriteLn;
FOR Loop:=5 DOWNTO 1 DO
BEGIN
Write(Loop,' ');
Ring;
Delay(1000);
END;
WarmReboot;
END;
SEE ALSO : RebootComputer, ColdBoot, HardwareReset
FUNCTION Windows:Boolean; (Slicer)
PURPOSE : Returns TRUE if Windows 3.x, Windows 95 or Windows NT is
detected on the local computer.
SEE ALSO : DesqView, DOSShell, DoubleDOS, OS2, TopView, Windows_Real
PROCEDURE Windows_CriticalBegin; (Slicer)
PURPOSE : Disables task switching in Windows 3.0+
SEE ALSO : Windows_CriticalEnd
PROCEDURE Windows_CriticalEnd; (Slicer)
PURPOSE : Enables task switchin in Windows 3.0+
SEE ALSO : Windows_CriticalBegin
FUNCTION Windows_Real:Boolean; (Slicer)
PURPOSE : Returns TRUE if Windows is running in standard (real) mode.
SEE ALSO : DesqView, DOSShell, DoubleDOS, OS2, TopView, Windows
PROCEDURE Windows_Release; (Slicer)
PURPOSE : Releases the current timeslice to the operating system.
NOTES : This call is supported by Windows 3.0+, DOS 5+, DPMI 1.0+,
and OS/2 2.0+ for multitasking DOS applications. Windows
applications should not use this function.
SEE ALSO : Release, DOS_Release, DoubleDOS_Release, TopView_Release
FUNCTION Windows_Version:Word; (Slicer)
PURPOSE : Returns the current Windows version.
NOTES : The major version is returned in the low byte; the minor
version is returned in the high byte. The function is
unable to detect the exact version of Windows/386 2.x.
All 2.x versions are returned as 2.0.
SEE ALSO : DesqView_Version, DOS_Version, DoubleDOS_Version, OS2_Version,
TopView_Version
FUNCTION WinOldApVersion:Word; (Win95)
PURPOSE : Identifies the WinOldAp version.
NOTES : WinOldAp is a Windows extension that allows old applications
to access DDE, menus, and the clipboard.
Zero is returned if this version of WinOldAp does not
support clipboard access.
SEE ALSO : CloseClipboard, OpenClipboard, SetClipboardData
FUNCTION Within_Box(X,Y,X1,Y1,X2,Y2:LongInt):Boolean; (Math)
PURPOSE : Returns TRUE if the point (X,Y) is within the box defined
by (X1,Y1) to (X2,Y2).
NOTES : (x1,y1) ┌───────────┐ (x2,y1)
│ ■ ■ │
│ │
│ │
│ ■ ■ │
(x1,y2) └───────────┘ (x2,y2)